vue.js 2.0 和vue.js 3.0依赖收集
2021-10-21 18:57:23 0 举报
vue.js 2.0 和vue.js 3.0依赖收集过程
作者其他创作
大纲/内容
mutableInstrumentations
reactive
Dep
setter
addDep
mutableCollectionHandlers:对集合代理的操作
depsMap
reactiveEffect
Observer
defineReactive
effectStack.pop
createReactiveObject
queueWatcher
trigger 触发
add
effect
track 依赖收集
observe
dependArray
walk
new Proxy
createReactiveEffect
effectStack
getter
Dep = Set<ReactiveEffect>
set
observeArray
depend
handlers(collectionHandlers、baseHandlers)
Array.isArray(value)
notify
subs: Array
遍历key
dep.has(activeEffect)
run
Container
Watcher
挂载effect属性
cleanup
target
depsMap.get(key)
update
get
不包含
effectStack.pushactiveEffect = effectretrun fn()
0 条评论
下一页