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

如何理解虚拟DOM #262

Open
hehongwei44 opened this issue May 15, 2018 · 2 comments
Open

如何理解虚拟DOM #262

hehongwei44 opened this issue May 15, 2018 · 2 comments

Comments

@hehongwei44
Copy link
Owner

链接:https://www.zhihu.com/question/29504639

@hehongwei44
Copy link
Owner Author

深度剖析:如何实现一个 Virtual DOM 算法: livoras/blog#13

@hehongwei44
Copy link
Owner Author

Virtual DOM 算法。包括几个步骤:

  1. 用 JavaScript 对象结构表示 DOM 树的结构;然后用这个树构建一个真正的 DOM 树,插到文档当中
  2. 当状态变更的时候,重新构造一棵新的对象树。然后用新的树和旧的树进行比较,记录两棵树差异
  3. 把2所记录的差异应用到步骤1所构建的真正的DOM树上,视图就更新了

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

No branches or pull requests

1 participant