window.$dbeventer.sub

<el-button @click="handleDbSub">订阅</el-button>
    <el-button @click="handleDbSet">推送</el-button>
     handleDbSub() {
        window.$dbeventer.sub('test', (code, res) => {
          console.log('订阅code', code);
          console.log('订阅res', res);
        }
        );
      },
      handleDbSet() {
        window.$dbeventer.set('test', { test: 33 }, (code, res) => {
          console.log('推送code', code);
          console.log('推送res', res);
        }
        );
      },
 handleDbSub() {
        let that = this;
        const did = `${that.config.response.mkey}`;
        window.$dbeventer.sub(did, (code, res) => {
          if(!res.formCompTag&&!res.data){
            console.log("传递的值必须包含formCompTag、data");
            return;
          }
          res = {
            formCompTag: "",
            data: {}
          };
          console.log('订阅code', code);
          console.log('订阅res', res);
        }
        );
      },
文档更新时间: 2022-11-05 08:05   作者:admin