02 2021 档案

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