You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
这个也还称元编程,有点意思,什么是元编程,看下维基百科的解释:
Metaprogramming is a programming technique in which computer programs have the ability to treat other programs as their data.
参考资料: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
ES6视频资料: https://ke.qq.com/course/274758?taid=1770527253606726
认识一下 ES6中的 Proxy
这里简单介绍下,record一下,因为此API功能及其强大,后面慢慢记录.
fullName
属性,以及如果没有属性了,提示信息换一下以上的handler,做了两件事,添加了一个
fullName
属性,并且加了一个友好的提示语小结: 大家有没有发现,其实
Proxy
就是用来,增强(装饰或者叫赋能)一个对象的刚刚我们使用了 handler里面的
get
,除此之外还有:更详细的,大家可以看: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
set
作用Proxy
这个功能其实非常有想象力,后续浏览器也会重点优化更新此API,其他能想到的案例应用:deleteProperty
)get
,set
)set
), Vue3.0重构使用就是它The text was updated successfully, but these errors were encountered: