
js Proxy in Action
攔截 vue data 對象

const target = {
msg1: "hello",
msg2: "everyone",
};
const handler = {
get: function(target, prop, receiver) {
console.log('target, prop, receive', target, prop, receiver);
return "world";
}
};
const proxy = new Proxy(target, handler);
console.log(proxy.msg1);
// world
console.log(proxy.msg2);
// world