当前位置:网站首页>组件的通信
组件的通信
2022-07-07 03:12:00 【要成为光的女人】
之前在写组件嵌套讲解的时候:
App组件时headers 组件的父组件;
一、在开发过程中,我们会经常遇到组件之间相互进行通信:
- 比如App 可能使用了很多个Header,每个地方的Header展示的内容不同,那么我们就需要使用者传递Header一些数据,让其进行展示;
- 又比如我们在Main中一次性请求了Banner数据和ProductList数据,那么就需要传递给它们进行展示
- 也有可能是子组件中发生了事件,需要由父组件来完成某些操作,那就需要子组件向父组件传递事件;
二、父子组件之间通信的方式
- 父组件传递给子组件:通过props属性;
- 子组件传递给父组件:通过$emit触发事件;
边栏推荐
- How can brand e-commerce grow against the trend? See the future here!
- Prompt for channel security on the super-v / device defender side when installing vmmare
- 剑指offer-高质量的代码
- 健身房如何提高竞争力?
- 【mysqld】Can't create/write to file
- 华为机试题素数伴侣
- Cloudcompare point pair selection
- 请教一下,监听pgsql ,怎样可以监听多个schema和table
- Leetcode t1165: log analysis
- Config distributed configuration center
猜你喜欢

循环肿瘤细胞——Abnova 解决方案来啦

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

如何给目标机器人建模并仿真【数学/控制意义】

This article introduces you to the characteristics, purposes and basic function examples of static routing

品牌·咨询标准化

Big coffee gathering | nextarch foundation cloud development meetup is coming

. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context

Unity3d learning notes

Mysql---- import and export & View & Index & execution plan

Redhat5 installing vmware tools under virtual machine
随机推荐
化工园区危化品企业安全风险智能化管控平台建设四大目标
Jmeter 5.5版本发布说明
Tool class: object to map hump to underline underline hump
sqlserver多线程查询问题
How can flinksql calculate the difference between a field before and after update when docking with CDC?
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
A slow SQL drags the whole system down
MYSQL----导入导出&视图&索引&执行计划
Libcurl returns curlcode description
一条慢SQL拖死整个系统
Matlab tips (29) polynomial fitting plotfit
JESD204B时钟网络
impdp的transform参数的测试
途家、木鸟、美团……民宿暑期战事将起
Distributed ID solution
Several index utilization of joint index ABC
from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
带你刷(牛客网)C语言百题(第一天)
什么情况下考虑分库分表
Prime partner of Huawei machine test questions