当前位置:网站首页>Sibling components carry out value transfer (there is a sequence displayed)
Sibling components carry out value transfer (there is a sequence displayed)
2022-07-05 18:09:00 【inticaler】
In development, we will encounter two brother components , After the elder brother finished the execution, the younger brother showed , Brother hides , In this case, we need to reconsider the order of execution
such as
New middleware ,bus.js, Let all brothers share the same value passing event mechanism .
import Vue from 'vue'
export default new Vue
stay child_1.vue( brother ) In the component , The binding event
import Bus from "@/utils/bus.js"
mounted() {
Bus.$on('getMergeId', this.getMergeId)
},
methods: {
getMergeId(callback) {
if (callback) callback(this.id);
},
}
stay child_2.vue( Younger brother ) In the component , Trigger event to get value
import Bus from "@/utils/bus.js"
Bus.$emit("getMergeId", id => {
this.id = id
});
Then you can get the brother component in the brother component data Worth it
边栏推荐
- 第十一届中国云计算标准和应用大会 | 华云数据成为全国信标委云计算标准工作组云迁移专题组副组长单位副组长单位
- What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
- Neural network self cognition model
- Leetcode notes: Weekly contest 300
- 访问数据库使用redis作为mysql的缓存(redis和mysql结合)
- Access the database and use redis as the cache of MySQL (a combination of redis and MySQL)
- 【在優麒麟上使用Electron開發桌面應】
- 彻底理解为什么网络 I/O 会被阻塞?
- Operation before or after Teamcenter message registration
- OpenShift常用管理命令杂记
猜你喜欢
Privacy computing helps secure data circulation and sharing
Star Ring Technology launched transwarp Navier, a data element circulation platform, to help enterprises achieve secure data circulation and collaboration under privacy protection
修复漏洞 - mysql 、es
nano的CAN通信
Can communication of nano
buuctf-pwn write-ups (9)
What are the requirements for PMP certification? How much is it?
[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business
Failed to virtualize table with JMeter
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
随机推荐
[use electron to develop desktop on youqilin]
[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business
Neural network self cognition model
Find the first k small element select_ k
Introduction to Resampling
吳恩達團隊2022機器學習課程,來啦
How awesome is the architecture of "12306"?
node_ Exporter memory usage is not displayed
《2022中国信创生态市场研究及选型评估报告》发布 华云数据入选信创IT基础设施主流厂商!
EPM related
[BeanShell] there are many ways to write data locally
Career advancement Guide: recommended books for people in big factories
About Statistical Power(统计功效)
matlab内建函数怎么不同颜色,matlab分段函数不同颜色绘图
让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V
Size_ T is unsigned
To solve the stubborn problem of Lake + warehouse hybrid architecture, xinghuan Technology launched an independent and controllable cloud native Lake warehouse integrated platform
Cmake tutorial Step4 (installation and testing)
Sophon CE社区版上线,免费Get轻量易用、高效智能的数据分析工具