let person = {
name: "张三",
age: 18
}
const p = new Proxy(person,{
get(target, propName){
return Reflect.get(target,propName)
}
set(target, propName,value){
return Reflect.set(target,propName,value)
}
deleteProperty(target, propName) {
return Reflect.deleteProperty(target,propName)
}
})
网友评论