当前位置:网站首页>$refs:组件中获取元素对象或者子组件实例:
$refs:组件中获取元素对象或者子组件实例:
2022-07-07 03:12:00 【要成为光的女人】
1.在某些情况下,我们在组件中想要直接获取到元素对象或者子组件实例:
- 在Vue开发中我们是不推荐进行DOM操作的;
- 在这个时候,我们可以给元素或者组件绑定一个ref的attribute属性;
组件实例有一个$refs属性:
他有一个对象Object,持有注册过 ref attribute 的所有DOM元素和组件实例;
边栏推荐
- Config分布式配置中心
- jdbc数据库连接池使用问题
- MySQL的主从复制原理
- SolidWorks GB Library (steel profile library, including aluminum profile, aluminum tube and other structures) installation and use tutorial (generating aluminum profile as an example)
- [GNN] graphic gnn:a gender Introduction (including video)
- Brand · consultation standardization
- Libcurl returns curlcode description
- 企业如何进行数据治理?分享数据治理4个方面的经验总结
- 【luogu P1971】兔兔与蛋蛋游戏(二分图博弈)
- 联合索引ABC的几种索引利用情况
猜你喜欢
随机推荐
unity3d学习笔记
FPGA课程:JESD204B的应用场景(干货分享)
毕业设计游戏商城
String (explanation)
精准时空行程流调系统—基于UWB超高精度定位系统
Under what circumstances should we consider sub database and sub table
After the promotion, sales volume and flow are both. Is it really easy to relax?
Unity3d learning notes
栈题目:有效括号的嵌套深度
联合索引ABC的几种索引利用情况
How can brand e-commerce grow against the trend? See the future here!
2022/07/04学习记录
使用net core优势/为什么使用
Graduation design game mall
什么情况下考虑分库分表
Stack and queue-p78-8 [2011 unified examination true question]
Unable to debug screen program with serial port
Installing redis and windows extension method under win system
请问 flinksql对接cdc时 如何实现计算某个字段update前后的差异 ?
2022年全国所有A级景区数据(13604条)