当前位置:网站首页>组件的通信
组件的通信
2022-07-07 03:12:00 【要成为光的女人】
之前在写组件嵌套讲解的时候:
App组件时headers 组件的父组件;
一、在开发过程中,我们会经常遇到组件之间相互进行通信:
- 比如App 可能使用了很多个Header,每个地方的Header展示的内容不同,那么我们就需要使用者传递Header一些数据,让其进行展示;
- 又比如我们在Main中一次性请求了Banner数据和ProductList数据,那么就需要传递给它们进行展示
- 也有可能是子组件中发生了事件,需要由父组件来完成某些操作,那就需要子组件向父组件传递事件;
二、父子组件之间通信的方式
- 父组件传递给子组件:通过props属性;
- 子组件传递给父组件:通过$emit触发事件;
边栏推荐
猜你喜欢
![[noi simulation] regional division (conclusion, structure)](/img/7d/4c66cd0a30e52ccd167b6138fcb4df.png)
[noi simulation] regional division (conclusion, structure)

MySQL的主从复制原理

Jetpack compose is much more than a UI framework~

Graduation design game mall

. Net core accesses uncommon static file types (MIME types)

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

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

从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型

Please answer the questions about database data transfer

毕业设计游戏商城
随机推荐
How DHCP router works
from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
Bus message bus
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
2022/07/04学习记录
健身房如何提高竞争力?
Kotlin之 Databinding 异常
Sqlserver multithreaded query problem
How to do sports training in venues?
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
Jetpack compose is much more than a UI framework~
AddressSanitizer 技术初体验
关于数据库数据转移的问题,求各位解答下
场馆怎么做体育培训?
化工园区危化品企业安全风险智能化管控平台建设四大目标
Please answer the questions about database data transfer
.net core 访问不常见的静态文件类型(MIME 类型)
Test of transform parameters of impdp
【NOI模拟赛】区域划分(结论,构造)
根据IP获取地市