当前位置:网站首页>$refs:组件中获取元素对象或者子组件实例:
$refs:组件中获取元素对象或者子组件实例:
2022-07-07 03:12:00 【要成为光的女人】
1.在某些情况下,我们在组件中想要直接获取到元素对象或者子组件实例:
- 在Vue开发中我们是不推荐进行DOM操作的;
- 在这个时候,我们可以给元素或者组件绑定一个ref的attribute属性;
组件实例有一个$refs属性:
他有一个对象Object,持有注册过 ref attribute 的所有DOM元素和组件实例;
边栏推荐
- 【mysqld】Can't create/write to file
- MySQL binlog related commands
- How to install swoole under window
- 大促过后,销量与流量兼具,是否真的高枕无忧?
- 多学科融合
- .net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context
- Abnova 膜蛋白脂蛋白体技术及类别展示
- Problems and precautions about using data pumps (expdp, impdp) to export and import large capacity tables in Oracle migration
- Several index utilization of joint index ABC
- Linear algebra (1)
猜你喜欢
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
. Net core accesses uncommon static file types (MIME types)
Installing redis and windows extension method under win system
LVS+Keepalived(DR模式)学习笔记
偏执的非合格公司
多个kubernetes集群如何实现共享同一个存储
【NOI模拟赛】区域划分(结论,构造)
MATLAB小技巧(30)非线性拟合 lsqcurefit
Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing
Matlab tips (29) polynomial fitting plotfit
随机推荐
Tool class: object to map hump to underline underline hump
MYSQL----导入导出&视图&索引&执行计划
Sword finger offer high quality code
Abnova 免疫组化服务解决方案
什么情况下考虑分库分表
Stack and queue-p79-10 [2014 unified examination real question]
MYSQL binlog相关命令
请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?
CompletableFuture使用详解
JWT的基础介绍
Matlab tips (30) nonlinear fitting lsqcurefit
The startup of MySQL installed in RPM mode of Linux system failed
Answer to the second stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition
jdbc数据库连接池使用问题
工具类:对象转map 驼峰转下划线 下划线转驼峰
String (explanation)
大促过后,销量与流量兼具,是否真的高枕无忧?
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
Kotlin之 Databinding 异常
MySQL binlog related commands