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

边栏推荐
- . Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
- Stack and queue-p79-9
- 【NOI模拟赛】区域划分(结论,构造)
- 【mysqld】Can't create/write to file
- 服装门店如何盈利?
- 算法---比特位计数(Kotlin)
- leetcode 509. Fibonacci Number(斐波那契数字)
- .net core 访问不常见的静态文件类型(MIME 类型)
- 循环肿瘤细胞——Abnova 解决方案来啦
- 使用net core优势/为什么使用
猜你喜欢

2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书

MOS管参数μCox得到的一种方法

SolidWorks的GB库(钢型材库,包括铝型材、铝管等结构)安装及使用教程(生成铝型材为例)

Use of completable future

Anr principle and Practice
![Stack and queue-p78-8 [2011 unified examination true question]](/img/df/72ba22f1953551943494d661a56a3b.jpg)
Stack and queue-p78-8 [2011 unified examination true question]

一文带你了解静态路由的特点、目的及配置基本功能示例

Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données

Config distributed configuration center

JWT的基础介绍
随机推荐
MySQL (x)
MOS管参数μCox得到的一种方法
Sqlserver multithreaded query problem
MYSQL----导入导出&视图&索引&执行计划
栈题目:有效括号的嵌套深度
This article introduces you to the characteristics, purposes and basic function examples of static routing
基于JS的迷宫小游戏
FPGA课程:JESD204B的应用场景(干货分享)
After the promotion, sales volume and flow are both. Is it really easy to relax?
反射(二)
[GNN] graphic gnn:a gender Introduction (including video)
【mysqld】Can't create/write to file
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书
【NOI模拟赛】区域划分(结论,构造)
如何给目标机器人建模并仿真【数学/控制意义】
Advantages of using net core / why
偏执的非合格公司
MATLAB小技巧(30)非线性拟合 lsqcurefit
Several index utilization of joint index ABC
How can clothing stores make profits?