摘要: Es6新增对象方法的访问描述符:get(只读)、set(只写),可以直接使用,一般用于数据监听,用途类似于vue.$watch。 var obj = { a:1, get bar() { return this.a}, set bar(a) { this.a = a; return this.a } 阅读全文
posted @ 2019-01-21 11:29 比诺 阅读(1777) 评论(0) 推荐(0) 编辑