-
import { Addon } from '@antv/x6'
- initShape=(e)=> {
// 拖拽添加节点
const dnd = new Addon.Dnd({
target: this.graph, //目标画布(必传)
animation: true
})
const node= this.graph.createNode({
width: 100,
height: 100,
shape: 'rect',
attrs: {
body: {
fill: '#ccc'
}
}
})
dnd.start(node, e)
}
// 使用
<Button onMouseDown={e => initShape(e)}> node </Button>
流程图拖拽
最新推荐文章于 2023-11-01 14:09:27 发布