vue源码解析-computed原理图
2020-12-30 11:33:13 0 举报
vue源码解析-computed原理图
作者其他创作
大纲/内容
6. watcher.depend()
2. mount时创建
//myproject/src/views/myview.vue<template> ... {{ sum }} ...</template>export default { data() { return {span style=\"font-size: inherit;\
vm.sum: computedGetter
3. get
1. create时调用
8. deps[1].depend()
data.a getter
data.b getter
data
evaluate: this.a + this.b
4. watcher.evaluate()
initComputed
depend() { let i = this.deps.length while (i--) { this.deps[i].depend() }}
sum的computed watchervm.watchers['sum']
5. get
render watcher
8. deps[0].depend()
收藏
0 条评论
下一页