123456789101112131415161718192021222324252627 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- var obj = {
- name: 'zs'
- }
- var a = new Proxy(obj,{
- get(target,key,property){
- console.log(target,key,property)
- },
- set(target,key,value){
- console.log(target,key,value)
- return target[key] = value
- }
- })
- a.name = 'lisi'
- console.log(a.get)
- </script>
- </body>
- </html>
|