-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Labels
bug: need confirmMaybe a bug, waiting for confirmationMaybe a bug, waiting for confirmation
Description
Environment
- Node:20.5.0
- vue:3.4.26设备/浏览器
都能
描述一下你的问题
数据切换 拿到data 进行设置
editor.value.setData(data)
通过拖拽 创建的 fileds 会给数据 添加配置
wrapElement 触发
generatorData(el, isWrap, lang.value, sourceBlock, node => {
addFieldData(node)
addField(node)
})
执行到此:
state 的数据是第一次setData的值
导致所有的拖拽功能无法正确执行 报错
初步判断是由于:
const dragOptions = {
swapThreshold: 1,
group: {
name: 'er-Canves'
},
parent: props.parent,
plugins: [ControlInsertionPlugin(ER)],
ControlInsertion: true
}
定义的 ControlInsertionPlugin 插件 注入的 ER 只会执行第一次
导致后续的 state 都是 历史旧值
希望能得到解决
重现步骤
<er-form-editor
ref="EReditorRef"
:file-upload-u-r-i="uploadFileApi"
@Listener="handleListener"
/>
EReditorRef.value.setData(data1)
// 后面改为:
EReditorRef.value.setData(data2)
拖拽功能报错
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bug: need confirmMaybe a bug, waiting for confirmationMaybe a bug, waiting for confirmation