提交 ce2bf577 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 d511a02d
......@@ -105,16 +105,15 @@ const onDrop = (event: DragEvent) => {
})
}
const onAddText = () => {
const onAddText = (event: MouseEvent) => {
if (!vueFlowRef.value) return
const { left, top } = vueFlowRef.value.getBoundingClientRect()
console.log(left, top)
const { width } = vueFlowRef.value.getBoundingClientRect()
const position = project({ x: width - 158, y: 60 })
const newNode = {
id: nanoid(4),
type: 'text',
position: { x: 0, y: 0 },
label: '说明'
position,
label: '编辑说明'
}
addNodes([newNode])
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论