learnVue icon indicating copy to clipboard operation
learnVue copied to clipboard

依赖收集里的这行代码是什么意思?怎么感觉缺东西

Open horseson2018 opened this issue 5 years ago • 4 comments

class Vue {
    constructor(options) {
        this._data = options.data;
        observer(this._data, options.render);
        let watcher = new Watcher(this, ); // 这括号里是没写完吗
    }
}

horseson2018 avatar Jun 29 '20 12:06 horseson2018

这里应该是实例化一个渲染watcher,在watcher里面会执行updateComponent回调

yilujun100 avatar Jul 14 '20 11:07 yilujun100

我也觉得依赖收集这里代码不完整,还有Dep.target=null的执行位置是不是不对?

cute1baby avatar Dec 05 '20 06:12 cute1baby

这里应该也是要传一个options.render吧

new Watcher(this, null, options.render)

topul avatar Mar 12 '21 08:03 topul