mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-05-08 17:48:47 +00:00
补全方法的参数类型、返回值类型与详情说明,规范字段编辑器/字段配置/运行时 API 等文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
3.4 KiB
3.4 KiB
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