属性描述符与Proxy的区别&Vue3.0为何改用Proxy

Memory丶melody 3 0 PDF 2021-01-16 20:01:35

属性描述符 什么是属性描述符? 属性描述符就是一个属性除了属性名与属性值之外的其他相关信息 通过Object.getOwnPropertyDescriptor(对象, 属性名)可以得到一个对象的某个属性的属性描述符 let obj = { a: 1 } console.log(Object.getOwnPropertyDescriptor(obj, 'a')); // { // value: 1, // writable: true, // enumerable: true, // configurable: true // } 通过Object.ge

用户评论
请输入评论内容
评分:
暂无评论