当前位置:网站首页>组件的通信
组件的通信
2022-07-07 03:12:00 【要成为光的女人】
之前在写组件嵌套讲解的时候:
App组件时headers 组件的父组件;
一、在开发过程中,我们会经常遇到组件之间相互进行通信:
- 比如App 可能使用了很多个Header,每个地方的Header展示的内容不同,那么我们就需要使用者传递Header一些数据,让其进行展示;
- 又比如我们在Main中一次性请求了Banner数据和ProductList数据,那么就需要传递给它们进行展示
- 也有可能是子组件中发生了事件,需要由父组件来完成某些操作,那就需要子组件向父组件传递事件;
二、父子组件之间通信的方式
- 父组件传递给子组件:通过props属性;
- 子组件传递给父组件:通过$emit触发事件;
边栏推荐
- Jmeter 5.5版本发布说明
- From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
- MYSQL----导入导出&视图&索引&执行计划
- 多个kubernetes集群如何实现共享同一个存储
- impdp的transform参数的测试
- ip地址那点事
- Maze games based on JS
- MySQL view bin log and recover data
- ViewModelProvider.of 过时方法解决
- LVS+Keepalived(DR模式)学习笔记
猜你喜欢
![Stack and queue-p79-10 [2014 unified examination real question]](/img/7f/e5bba2f64bb77e1781076361c32f01.jpg)
Stack and queue-p79-10 [2014 unified examination real question]

ip地址那点事

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

JDBC database connection pool usage problem

MATLAB小技巧(30)非线性拟合 lsqcurefit

JESD204B时钟网络

多个kubernetes集群如何实现共享同一个存储

Jetpack compose is much more than a UI framework~

Matlab tips (30) nonlinear fitting lsqcurefit

Network foundation - header, encapsulation and unpacking
随机推荐
Complete process of MySQL SQL
多学科融合
MySql用户权限
JWT的基础介绍
Basic introduction of JWT
【JDBC以及内部类的讲解】
The latest trends of data asset management and data security at home and abroad
How to model and simulate the target robot [mathematical / control significance]
String (explanation)
关于数据库数据转移的问题,求各位解答下
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
MATLAB小技巧(29)多项式拟合 plotfit
从零到一,教你搭建「CLIP 以文搜图」搜索服务(二):5 分钟实现原型
Test of transform parameters of impdp
Redhat5 installing vmware tools under virtual machine
Stack and queue-p79-10 [2014 unified examination real question]
数据资产管理与数据安全国内外最新趋势
使用TCP/IP四层模型进行网络传输的基本流程
7天零基础能考证HCIA吗?华为认证系统学习路线分享
Stack and queue-p79-9