Skip to content

Commit 8616a69

Browse files
committed
feat: 2021.01.29
1 parent 060bf41 commit 8616a69

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Cute-ReadingNotes/探索 Vue.js 响应式原理.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ Vue.js 响应式原理中,**观察者模式起到非常重要的作用**。其
288288

289289
- `Dep` 被观察者类,提供用来收集观察者( `addSub` )方法和通知观察者( `notify` )方法;
290290
- `Watcher` 观察者类,实例化时支持传入回调( `cb` )方法,并提供更新( `update` )方法;
291-
-
291+
292292
### 2. 实现生成响应式的类
293293

294294
这一步需要实现 `Observer` 类,核心是通过 `Object.defineProperty()` 方法为对象的每个属性设置 getter/setter,目的是**将普通数据转换为响应式数据,从而实现响应式对象**
@@ -392,7 +392,7 @@ document.querySelector('#update').addEventListener('click', function(){
392392

393393
![observer-watcher-dep.png](https://images.pingan8787.com/Vue/Reactive/observer-watcher-dep.png)
394394

395-
## 五、Vue.js 响应式实现
395+
## 五、实现简单 Vue.js 响应式
396396

397397
> 本节代码:[https://github.com/pingan8787/Leo-JavaScript/blob/master/Cute-Gist/Vue/leo-vue-reactive/](https://github.com/pingan8787/Leo-JavaScript/blob/master/Cute-Gist/Vue/leo-vue-reactive/compile.js)
398398

0 commit comments

Comments
 (0)