跳至主要內容

监听指令

2025年1月17日小于 1 分钟

监听指令

基本信息

用于监听外部发送的指令。

示例

1.在其他页面中添加发送指令事件

const iframe = document.getElementsById('iframe');
// 指令接收的数据对象
const commandObj = {
  hetu: {
    command: '饼图'
  }
};
// 发送指令
iframe.contentWindow.postMessage(commandObj, '*');

2.在设计器中添加饼图和环形饼图两个组件

3.在节点编程中添加监听指令、条件判断、饼图、环形饼图

4.预览看效果

上次编辑于: 2025/2/26 14:19:58
贡献者: yaodd,xuch