-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.x 的X6 node.setData()无法做到强制替换 #3262
Comments
现象 1 和 2 中 value 值分别是什么? |
原始数据 现象1:使用{ overwrite: true }
现象2:不用{ overwrite: true }
|
尝试repalceData()、updateData(),以及增加各种option,都无法实现既能修改数组元素属性值、删除数组元素两个操作。 |
我也刚遇到了类似的问题。 |
妈呀,相同的问题,issue 翻了一圈终于找到一个解决方案了😂感谢 |
解决了吗?遇到相同的问题 |
问题描述
背景
{
attr:{...},
port:{...},
data: {
"text": "",
"shapeStyle": {
"color": "#14AE5C",
"fillMode": "stroke",
"fillColor": "#14AE5C",
"fontColor": "#fff",
"borderColor": "#0f8044",
"borderStyle": "solid"
},
"shapeType": "flow-lane",
"shapeConf": {
"lanes": [
{
"name": "泳道A",
"width": 223
},
{
"name": "泳道B",
"width": 220
},
{
"name": "泳道C",
"width": 220
}
]
}
}
...
}
问题:setData()生效范围令人迷惑,{ overwrite: true}无法做到强制替换更新
重现链接
暂无
重现步骤
现象1:option里有{ overwrite: true}时,支持删除lane数组内元素,但是不支持修改元素属性
props.node.setData({ ...props.node.getData(), ...value }, { overwrite: true})
现象2:去掉{ overwrite: true}时,仅支持修改lane数组内元素属性,不支持删除元素
props.node.setData({ ...props.node.getData(), ...value })
预期行为
overwrite时,请完全以我输入的为准。
或者,说明白overwrite的作用方式。
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: