当前位置:网站首页>子组件传递给父组件
子组件传递给父组件
2022-07-07 03:12:00 【要成为光的女人】
1.什么样的情况下子组件祖尧传递内容到付组件呢?
- 当子组件有一些事件发生的时候,比如在组件中发生了点击,父组件需要切换内容;
- 子组件有一些内容想要传递给父组件的时候;
我们如何完成上面的操作呢?
- 首先,我们需要在子组件中定义好在某些情况下触发的事件名称;
- 其次,在父组件中以v-on 的方式传入要监听的事件名称,并且绑定到对应的方法中
- 最后,在子组件中发生某个事件的时候,根据事件名称触发对应的事件;
小案例:



传递事件时,同时也可以传递一个参数。

接收处理这个参数:

边栏推荐
- Cloudcompare point pair selection
- Exception of DB2 getting table information: caused by: com ibm. db2.jcc. am. SqlException: [jcc][t4][1065][12306][4.25.13]
- from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
- 品牌·咨询标准化
- 一条慢SQL拖死整个系统
- 2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
- After the promotion, sales volume and flow are both. Is it really easy to relax?
- 请教一下,监听pgsql ,怎样可以监听多个schema和table
- 分布式id解决方案
- How can flinksql calculate the difference between a field before and after update when docking with CDC?
猜你喜欢

DHCP路由器工作原理

MATLAB小技巧(29)多项式拟合 plotfit

Unable to debug screen program with serial port

String (explanation)

Prime partner of Huawei machine test questions

Cloudcompare point pair selection

Linear algebra (1)

服装门店如何盈利?
![Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]](/img/13/096857158c9f977f8677f7cd0f9d4b.png)
Navicat importing 15g data reports an error [2013 - lost connection to MySQL server during query] [1153: got a packet bigger]

MOS管参数μCox得到的一种方法
随机推荐
Distributed ID solution
Maze games based on JS
Brand · consultation standardization
循环肿瘤细胞——Abnova 解决方案来啦
AVL树的实现
2022年全国所有A级景区数据(13604条)
MySQL SQL的完整处理流程
jdbc数据库连接池使用问题
JWT的基础介绍
一条慢SQL拖死整个系统
Stack and queue-p78-8 [2011 unified examination true question]
Sword finger offer high quality code
Leetcode T1165: 日志分析
How can clothing stores make profits?
JESD204B时钟网络
The startup of MySQL installed in RPM mode of Linux system failed
Redhat5 installing vmware tools under virtual machine
Please answer the questions about database data transfer
sqlserver多线程查询问题
Tool class: object to map hump to underline underline hump