function bindDataToElement(data) { const proxy = new Proxy(data, { set(target, key, value) { target[key] = value; return true; }, }); console.log("proxy", proxy); } window.onload = () => { const data = { name: "张三", age: 20 }; bindDataToElement(data); };