Skip to content

mt-preview

预览组件

属性

属性名说明默认值类型
exportJson默认加载的数据IExportJson
canZoom控制能否拖动ctrl+鼠标滚轮缩放画布trueboolean
canDrag控制能否通过鼠标左键拖动画布trueboolean
showPopover鼠标悬浮时显示图元属性trueboolean

事件

事件名说明类型
onEventCallBack触发回调函数(type: string, item_id: string, ...args: any[]) =>void

方法

方法名说明类型
setImportJson设置要加载的数据(exportJson: IExportJson) => boolean
setItemAttrByID通过id设置图元属性(id: string, key: string, val: any) => Promise
setItemAttrs批量设置图元属性(info: { id: string; key: string; val: any;}[]) => void