fix(core): 修复antd Tree组件报错

This commit is contained in:
huangxuan 2024-04-02 11:08:16 +08:00
parent 4a825cec88
commit 0375ed95fc
No known key found for this signature in database
GPG Key ID: E79F50C67022565D
1 changed files with 4 additions and 0 deletions

View File

@ -200,6 +200,10 @@ function getChildByIndex(vNode: VNode, idx: number) {
// 从多个更新节点中,计算出开始节点。即:找到最近的共同的父辈节点
export function calcStartUpdateVNode(treeRoot: VNode) {
const toUpdateNodes = Array.from(treeRoot.toUpdateNodes!);
// 所有待更新元素的parent为null说明该node的父元素已经被卸载应该从根节点发起更新
if (toUpdateNodes.every(node => node.parent === null)) {
return treeRoot;
}
if (toUpdateNodes.length === 0) {
return treeRoot;