mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-26 19:19:59 +08:00
fix(editor): 更新组件后,组件树选中状态被重置
This commit is contained in:
parent
b8cda53d6a
commit
e0c0143970
@ -221,10 +221,15 @@ watch(nodes, (nodes) => {
|
|||||||
) {
|
) {
|
||||||
tree.value?.setCheckedKeys([], false);
|
tree.value?.setCheckedKeys([], false);
|
||||||
|
|
||||||
[currentNodeKey.value] = ids;
|
|
||||||
checkedKeys.value = ids.filter((id) => id !== page.value?.id);
|
checkedKeys.value = ids.filter((id) => id !== page.value?.id);
|
||||||
expandedKeys.value = union(expandedKeys.value, ids);
|
expandedKeys.value = union(expandedKeys.value, ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[currentNodeKey.value] = ids;
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
tree.value?.setCurrentKey(currentNodeKey.value);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(isMultiSelect, (isMultiSelect) => {
|
watch(isMultiSelect, (isMultiSelect) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user