We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1、
const newVNode = { type: 'div', children: [ { type: 'p', children: 'world', key: 3 }, ] } const oldVNode = { type: 'div', children: [ { type: 'p', children: '3', key: 3 }, { type: 'p', children: '2', key: 2 }, ] }
使用上面案例代入快速diff案例中,会爆错,应该增加oldVNode ,newVNode 是否为undefined的判断
while (oldVNode.key === newVNode.key) { patch(oldVNode, newVNode, container) j++; oldVNode = oldChildren[j]; newVNode = newChildren[j]; }
2、 使用该案例不能正常添加新节点,在顺序没有改变(move=false)并且有新节点增加的情况下,不能挂载新节点
const newVNode = { type: 'div', children: [ { type: 'p', children: 'world', key: 3 }, { type: 'p', children: '1', key: 1 }, { type: 'p', children: '4', key: 4, }, ] } const oldVNode = { type: 'div', children: [ { type: 'p', children: '3', key: 3 }, { type: 'p', children: '2', key: 2 }, { type: 'p', children: '4', key: 4 }, ] }
The text was updated successfully, but these errors were encountered:
#149
Sorry, something went wrong.
No branches or pull requests
1、
使用上面案例代入快速diff案例中,会爆错,应该增加oldVNode ,newVNode 是否为undefined的判断
2、
使用该案例不能正常添加新节点,在顺序没有改变(move=false)并且有新节点增加的情况下,不能挂载新节点
The text was updated successfully, but these errors were encountered: