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专用的,其他的框架也在用
必要性:(源码中的mountComponent())vue中一个组件有一个Watcher,一一对应的关系,为了精确的知道在更新的过程中到底谁发生了变化,所以要使用diff。 执行方式:(源码中的patchVnode())patchVnode()是diff发生的地方。整体策略:深度优先,同层比较 高效性:(源码中的updateChildren())
当修改数据触发了setter,setter会触发通知,通知的触发方式是尝试把Watcher添加到异步更新队列,在每一次事件循环结束时要清空队列,清空队列的过程中,所有的Watcher尝试它们的更新函数,更新函数在执行时调用了组件的渲染函数以及组件的更新函数,这时候会重新渲染最新的虚拟DOM,然后执行更新函数比较新旧虚拟DOM,此时diff真正的触发了。
结论:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
并不是vue专用的,其他的框架也在用
必要性:(源码中的mountComponent())vue中一个组件有一个Watcher,一一对应的关系,为了精确的知道在更新的过程中到底谁发生了变化,所以要使用diff。
执行方式:(源码中的patchVnode())patchVnode()是diff发生的地方。整体策略:深度优先,同层比较
高效性:(源码中的updateChildren())
结论:
The text was updated successfully, but these errors were encountered: