02 2021 档案
摘要:思路:遍历data中的属性,将属性传入denfineReactive方法中,在defineReactive方法中通过Object.defineProperty重写get与set方法。 观察者模式(Watcher, Dep) 订阅:在defineReactive中创建了Dep实例,在getter方法中
阅读全文
摘要:es5继承: 借用构造函数 function A () { this.name = 'zsp' } A.prototype.sayHello = funtion() { console.log(`hi ${ this.name }`) } function B() { A.call(this) }
阅读全文

浙公网安备 33010602011771号