摘要:
通过Object.defineProperty实现了对对象属性的监听,但是Object.defineProperty对数组已有元素也是实现监听的,那么为什么vue中没有提供这一功能,使得arr[已有元素下标]=val变成响应式 Object.defineProperty 可以做到对数组的监听,它是支 阅读全文
摘要:
function set(target: Array<any> | Object, key: any, val: any): any { // isUndef 是判断 target 是不是等于 undefined 或者 null 。 //isPrimitive 是判断 target 的数据类型是不是 阅读全文