editorService事件
root-change
详情: dsl跟节点发生变化,editorService.set('root', {})后触发
select
详情: 选中组件,editorService.select()后触发
事件回调函数: (node: MNode) => void
add
详情: 添加节点后触发,editorService.add()后触发
事件回调函数: (node: MNode[]) => void
remove
详情: 删除节点后触发,editorService.remove()后触发
事件回调函数: (node: MNode[]) => void
update
详情: 更新组件后触发,editorService.update()后触发
事件回调函数: (data: Array<{ newNode: MNode; oldNode: MNode; changeRecords?: ChangeRecord[] }>) => void
move-layer
详情: 移动节点层级后触发,editorService.moveLayer()后触发
事件回调函数: (offset: number | LayerOffset) => void
其中
LayerOffset枚举值为'top'/'bottom'
drag-to
详情: 拖拽节点到指定容器后触发,editorService.dragTo()后触发
事件回调函数: (data: { targetIndex: number; configs: MNode | MNode[]; targetParent: MContainer }) => void
history-change
详情: 历史记录改变,editorService.redo(),editorService.undo()后触发
事件回调函数: (data: MPage | MPageFragment) => void