Skip to content
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

双端diff算法新增元素挂载描述错误 #222

Open
kaizhengya opened this issue Sep 24, 2024 · 1 comment
Open

双端diff算法新增元素挂载描述错误 #222

kaizhengya opened this issue Sep 24, 2024 · 1 comment

Comments

@kaizhengya
Copy link

错误的地方 可以看到第09行代码中为`const anchor = newChildren[newEndIdx + 1] ? newChildren[newEndIdx + 1].el : null` 倒数第二行描述的 “挂载时的锚点仍然使用当前的头部节点oldStartVNode.el” 应改为 “如果接下来有新的未处理节点,应该用下一个新节点的 DOM 元素作为锚点,以确保新节点插入的位置是正确的。当 newChildren[newEndIdx + 1] 不存在时,anchor 会是 null。此时会将新节点插入到容器的末尾。”
@kaizhengya
Copy link
Author

2024年3月第14次印刷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant