Match-id-b60858a00107b694e16612e9b5cb64237a31e501
This commit is contained in:
parent
d7a211a45a
commit
559038fe67
|
@ -43,7 +43,12 @@ const parseVNodeData = (rawData, idToTreeNodeMap , nextIdToTreeNodeMap) => {
|
||||||
const lastItem = idToTreeNodeMap[id];
|
const lastItem = idToTreeNodeMap[id];
|
||||||
if (lastItem) {
|
if (lastItem) {
|
||||||
// 由于 diff 算法限制,一个 vNode 的 name,userKey,indentation 属性不会发生变化
|
// 由于 diff 算法限制,一个 vNode 的 name,userKey,indentation 属性不会发生变化
|
||||||
|
// 但是在跳转到新页面时,id 值重置,此时原有 id 对应的节点都发生了变化,需要更新
|
||||||
|
// 为了让架构尽可能简单,我们不区分是否是页面跳转,所以每次都需要重新赋值
|
||||||
nextIdToTreeNodeMap[id] = lastItem;
|
nextIdToTreeNodeMap[id] = lastItem;
|
||||||
|
lastItem.name = name;
|
||||||
|
lastItem.indentation = indentation;
|
||||||
|
lastItem.userKey = userKey;
|
||||||
data.push(lastItem);
|
data.push(lastItem);
|
||||||
} else {
|
} else {
|
||||||
const item = {
|
const item = {
|
||||||
|
|
Loading…
Reference in New Issue