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

157.[vue]你怎么理解vue中的diff算法? #157

Open
webVueBlog opened this issue Apr 2, 2020 · 1 comment
Open

157.[vue]你怎么理解vue中的diff算法? #157

webVueBlog opened this issue Apr 2, 2020 · 1 comment
Labels
vue vue

Comments

@webVueBlog
Copy link
Member

[vue]

@webVueBlog webVueBlog added the vue vue label Apr 2, 2020
@webVueBlog
Copy link
Member Author

virtual dom,也就是虚拟节点,它通过JS的Object对象模拟DOM中的节点,然后再通过特定的render方法将其渲染成真实的DOM节点。

新旧虚拟dom的差异比较方法称为diff算法

简单的说就是新旧虚拟dom 的比较,如果有差异就以新的为准,然后再插入的真实的dom中,重新渲染
特点: 只会做同级比较,不做跨级比较

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

No branches or pull requests

1 participant