摘要:
构造函数和实例 class Person { constructor (name, age) { this.name = name this.age = age } } let vPerson = new Person('v', 10) console.log('构造函数和实例', vPerson) 继承 class Child extends Person { ... 阅读全文
摘要:
Proxy let obj = { time: '2019-01-01', name: 'ronle' } let monitor = new Proxy(obj, { // 拦截对象属性的读取 get (target, key) { return target[key].replace('2019', '2020') }, // 拦截对象设置属性 set (target, key, value) 阅读全文