当前位置:网站首页>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
边栏推荐
- Let more young people from Hong Kong and Macao know about Nansha's characteristic cultural and creative products! "Nansha kylin" officially appeared
- 含重复元素取不重复子集[如何取子集?如何去重?]
- 【pm2详解】
- matlab内建函数怎么不同颜色,matlab分段函数不同颜色绘图
- [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
- [paddlepaddle] paddedetection face recognition custom data set
- U-Net: Convolutional Networks for Biomedical Images Segmentation
- 彻底理解为什么网络 I/O 会被阻塞?
- LeetCode笔记:Weekly Contest 300
- Zabbix
猜你喜欢
[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
Career advancement Guide: recommended books for people in big factories
buuctf-pwn write-ups (9)
模拟百囚徒问题
About Statistical Power(统计功效)
使用QT遍历Json文档及搜索子对象
About Estimation with Cross-Validation
node_ Exporter memory usage is not displayed
ConvMAE(2022-05)
Leetcode daily question: the first unique character in the string
随机推荐
matlab内建函数怎么不同颜色,matlab分段函数不同颜色绘图
生词生词生词生词[2]
在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V
怎么选择外盘期货平台最正规安全?
Cmake tutorial Step2 (add Library)
LeetCode笔记:Weekly Contest 300
Tencent music launched its new product "quyimai", which provides music commercial copyright authorization
ClickHouse(03)ClickHouse怎么安装和部署
What are the changes in the 2022 PMP Exam?
Login and connect CDB and PDB
node_ Exporter memory usage is not displayed
Simulate the hundred prisoner problem
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
[paddlepaddle] paddedetection face recognition custom data set
Multithreading (I) processes and threads
Numerical calculation method chapter8 Numerical solutions of ordinary differential equations
Wu Enda team 2022 machine learning course, coming
MATLAB中print函数使用
Sophon autocv: help AI industrial production and realize visual intelligent perception