当前位置:网站首页>$refs:组件中获取元素对象或者子组件实例:
$refs:组件中获取元素对象或者子组件实例:
2022-07-07 03:12:00 【要成为光的女人】
1.在某些情况下,我们在组件中想要直接获取到元素对象或者子组件实例:
- 在Vue开发中我们是不推荐进行DOM操作的;
- 在这个时候,我们可以给元素或者组件绑定一个ref的attribute属性;
组件实例有一个$refs属性:
他有一个对象Object,持有注册过 ref attribute 的所有DOM元素和组件实例;

边栏推荐
- Please tell me how to monitor multiple schemas and tables by listening to PgSQL
- Linear algebra (1)
- Jetpack Compose 远不止是一个UI框架这么简单~
- Unable to debug screen program with serial port
- The startup of MySQL installed in RPM mode of Linux system failed
- Use of completable future
- 2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
- Take you to brush (niuke.com) C language hundred questions (the first day)
- Sword finger offer high quality code
- 肿瘤免疫治疗研究丨ProSci LAG3抗体解决方案
猜你喜欢

Prompt for channel security on the super-v / device defender side when installing vmmare

服装门店如何盈利?

Cloudcompare point pair selection

MATLAB小技巧(30)非线性拟合 lsqcurefit

循环肿瘤细胞——Abnova 解决方案来啦

Unable to debug screen program with serial port

Config distributed configuration center

How to install swoole under window

String (explanation)

LVS+Keepalived(DR模式)学习笔记
随机推荐
工具类:对象转map 驼峰转下划线 下划线转驼峰
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
SVN version management in use replacement release and connection reset
Matlab tips (29) polynomial fitting plotfit
oracle如何备份索引
Lvs+kept (DR mode) learning notes
Maze games based on JS
How to install swoole under window
Leetcode t1165: log analysis
服装门店如何盈利?
How Oracle backs up indexes
Mysql---- import and export & View & Index & execution plan
Leetcode T1165: 日志分析
ip地址那点事
Master-slave replication principle of MySQL
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
MySQL SQL的完整处理流程
肿瘤免疫治疗研究丨ProSci LAG3抗体解决方案
大咖云集|NextArch基金会云开发Meetup来啦
Abnova循环肿瘤DNA丨全血分离,基因组DNA萃取分析