fix(core): 修复antd Tree组件报错
This commit is contained in:
parent
4a825cec88
commit
0375ed95fc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue