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



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

接收处理这个参数:

边栏推荐
- 偏执的非合格公司
- 品牌电商如何逆势增长?在这里预见未来!
- Abnova 免疫组化服务解决方案
- Redhat5 installing vmware tools under virtual machine
- 数据资产管理与数据安全国内外最新趋势
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第一阶段答案
- How can brand e-commerce grow against the trend? See the future here!
- How to do sports training in venues?
- Please tell me how to monitor multiple schemas and tables by listening to PgSQL
- Jetpack Compose 远不止是一个UI框架这么简单~
猜你喜欢

How DHCP router works
![How to model and simulate the target robot [mathematical / control significance]](/img/bd/79f6338751b6773859435c54430ec3.png)
How to model and simulate the target robot [mathematical / control significance]

学术报告系列(六) - Autonomous Driving on the journey to full autonomy

MOS tube parameters μ A method of Cox

Abnova 免疫组化服务解决方案

Linear algebra (1)

2022年全国所有A级景区数据(13604条)

企业如何进行数据治理?分享数据治理4个方面的经验总结

Basic introduction of JWT

main函数在import语句中的特殊行为
随机推荐
Unity3d learning notes
linux系统rpm方式安装的mysql启动失败
Please answer the questions about database data transfer
AVL树的实现
Use of completable future
循环肿瘤细胞——Abnova 解决方案来啦
DHCP路由器工作原理
MySQL SQL的完整处理流程
2022/07/04学习记录
jdbc数据库连接池使用问题
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
JESD204B时钟网络
MySQL binlog related commands
Linear algebra (1)
ip地址那点事
Multidisciplinary integration
Comment les entreprises gèrent - elles les données? Partager les leçons tirées des quatre aspects de la gouvernance des données
SVN version management in use replacement release and connection reset
mysql查看bin log 并恢复数据
Learning records on July 4, 2022