当前位置:网站首页>Methods in Reflect
Methods in Reflect
2022-08-05 11:55:00 【Han.】
Reflect is similar to the method in Object. Vue3 uses two-way binding implemented by proxy and reflect. Therefore, let's learn the method in Reflect and deepen your understanding
1 Reflect.get
Usually used with proxy to get attribute value
let x={p:1,foo:2}let y={foo:3}let obj=new Proxy(x,{get(target,key,receiver){console.log(receiver[key]+'bar')}})Reflect.get(obj,'foo',y) //3bar2 Reflect.set
For setting properties
const target={set a(v){this.b=v}}const reveiver={}Reflect.set(target,'a',3span>,receiver)3 Reflect.has
Check for an attribute
4 Relfect.ownKeys
Used to traverse the object, you can traverse the properties of the symbol as the key name
5 Reflect.deleteProperty
Delete an attribute
边栏推荐
- 2022.08.02_每日一题
- 女人是这个世界上最美丽的生命
- 【着色器实现Flicker“DJ”闪烁效果_Shader效果第十五篇】
- 2022年6月互联网医疗领域月度观察
- STM32H743IIT6学习笔记02——USART
- LeetCode brush questions (8)
- 软件设计七大原则之开闭原则(Open-Closed Principle, OCP)
- Zhihu asks: Can China still achieve great national rejuvenation?
- Gao Zelong attended the Boao Global Tourism Ecology Conference to talk about Metaverse and Future Network Technology
- 623. 在二叉树中增加一行 : 简单二叉树遍历运用题
猜你喜欢
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?

尚硅谷-JUC篇

基于NSQ搭建高可用分布式消息队列

Shang Silicon Valley-JUC

Apache APISIX Ingress v1.5-rc1 released

Apache APISIX Ingress v1.5-rc1 发布

莅临GOPS大会龙智展位,获取Forrester最新报告:《Forrester Wave:2021年第四季度企业服务管理报告》

关注微信公众号,自动登陆网站

训练集Loss收敛,但是测试集Loss震荡的厉害?

华为分析&联运活动,助您提升游戏总体付费
随机推荐
尚硅谷-JVM-性能监控与调优篇(P302~P381)
花的含义
LeetCode刷题(8)
Keras 模型多输出 loss weight metrics 设置
互联网行业凛冬之至,BATM的程序员是如何应对中年危机的?
关注微信公众号,自动登陆网站
不是吧?还有人不会定位线上MySQL慢查询问题?
码率vs.分辨率,哪一个更重要?
798. 差分矩阵
2022.08.02_Daily question
treeselect common function record (with a callback function for clearing options)
深度学习(四)分析问题与调参 理论部分
C language classic examples - find the largest number in a series of numbers
高泽龙出席博鳌全球旅游生态大会 讲元宇宙与未来网络科技
面经汇总-社招-6年
2022.08.03_Daily Question
小红的aba子序列(离散化、二分、dp维护区间最短)
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
广告电商系统
【硬件架构的艺术】学习笔记(2)同步和复位