模拟代码错误

作者: lazyunderscore创建于 2019年11月18日更新于 2019年11月18日

开始依赖收集 `class Vue { constructor(options) { this._data = options.data; observer(this._data, options.render); let watcher = new Watcher(this, ); } }

  1. watcher 的定义应该在 observer 之前,否则,defineReactive 无法将其添加到 watcher 中
  2. watcher 定义缺少参数

内容来源: answershuto/learnVue