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
vue渲染器在更新列表时,会触发diff算法,diff算法依赖vnode上的key做算法优化。但在写模版时,除了v-for渲染列表会手写key。其他情况并不会去手写key,如:
<div id="parent"> <h1 id="child">1</h1> <h1 id="child">2</h1> <h1 id="child">3</h1> </div> ··· 更新时也会触发diff算法?
The text was updated successfully, but these errors were encountered:
所有更新都会触发diff算法。 另外,Vue 不会自动为 VNodes 添加 key,你需要自己负责添加。如果省略 key,Vue 会尝试使用其他方式来识别节点,但这可能会导致性能问题,特别是在列表频繁更新的情况下。
Sorry, something went wrong.
No branches or pull requests
vue渲染器在更新列表时,会触发diff算法,diff算法依赖vnode上的key做算法优化。但在写模版时,除了v-for渲染列表会手写key。其他情况并不会去手写key,如:
The text was updated successfully, but these errors were encountered: