let obj = { time: '2017-7-20', name: 'set', _r: 123
};let daili = new Proxy(obj,{ has(target,key){ if (key==='name'){ return target[key];
}else{ return false;
}
}
});console.log('name' in obj,'time' in obj); //true true 后面的應(yīng)該是false啊
1 回答

慕無(wú)忌1623718
TA貢獻(xiàn)1744條經(jīng)驗(yàn) 獲得超4個(gè)贊
console.log('name' in daili,'time' in daili);
添加回答
舉報(bào)
0/150
提交
取消