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

watcher和vue的watcher对应关系不一样吧 #44

Closed
LesterWeng opened this issue Nov 12, 2019 · 1 comment
Closed

watcher和vue的watcher对应关系不一样吧 #44

LesterWeng opened this issue Nov 12, 2019 · 1 comment

Comments

@LesterWeng
Copy link

项目里的一个watcher对应一个指令,而vue源码里是一个watcher对应一个vm,依赖变化触发mountComponent,patch vdom,之所以不一样是因为vue完全使用vdom的原因吗

@DMQ
Copy link
Owner

DMQ commented Dec 3, 2019

这里的实现是针对较早版本的vue,vue2支持vdom之后,指令这一块的处理不一样了。vue2中一个组件作用域内的任意数据变化,都会触发update函数执行,也就是 patch vdom相关的操作

@DMQ DMQ closed this as completed Dec 3, 2019
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

2 participants