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

为什么vue react 中列表渲染 用加 key #1

Open
w990752800 opened this issue Apr 2, 2020 · 0 comments
Open

为什么vue react 中列表渲染 用加 key #1

w990752800 opened this issue Apr 2, 2020 · 0 comments

Comments

@w990752800
Copy link
Owner

  1. 通过key比较两个节点是否相同,相同就复用,不同就重现渲染
  2. 不加key 性能会更好,不加key 就不会 销毁dom,只是替换里面的值,但是这样就不能区分组件的状态
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