first commit
This commit is contained in:
15
new_mush.js
Normal file
15
new_mush.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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);
|
||||
};
|
Reference in New Issue
Block a user