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
xingbofeng/xingbofeng.github.io#15
在初始化的时候
首先通过 Object.defineProperty 改写 getter/setter 为 Data 注入观察者能力
Object.defineProperty
getter/setter
Data
在数据被调用的时候,getter 函数触发,调用方(会为调用方创建一个 Watcher)将会被加入到数据的订阅者序列;
getter
Watcher
当数据被改写的时候,setter 函数触发,变更将会通知到订阅者(Watcher)序列中,并由 Watcher 触发 re-render。后续的事情就是通过 render function code 生成虚拟 DOM,进行 diff 比对,将不同反应到真实的 DOM 中。
setter
re-render
render function code
DOM
diff
The text was updated successfully, but these errors were encountered:
No branches or pull requests
xingbofeng/xingbofeng.github.io#15
在初始化的时候
首先通过
Object.defineProperty
改写getter/setter
为Data
注入观察者能力在数据被调用的时候,
getter
函数触发,调用方(会为调用方创建一个Watcher
)将会被加入到数据的订阅者序列;当数据被改写的时候,
setter
函数触发,变更将会通知到订阅者(Watcher
)序列中,并由Watcher
触发re-render
。后续的事情就是通过render function code
生成虚拟DOM
,进行diff
比对,将不同反应到真实的DOM
中。The text was updated successfully, but these errors were encountered: