当前位置:网站首页>eventBus
eventBus
2022-04-22 07:18:00 【滴噶】
1.在一个组件里面
引入eventbus
import eventBus from ‘…/mlib/util/eventbus.js’;
beforeDestroy(){
var that = this;
eventBus.$emit('configItemKey', {
'configItemKey': that.configItemKeylist,
'type': that.type,
'scrollTop':this.scrollTop
});
},
2.在另一个组件接收
created() {
eventBus.$off('configItemKey');先消除免得重复获取
this.getEventBus();
}
getEventBus() {
var that = this;
eventBus.$on('configItemKey', function (data) {
that.$nextTick(() => {
that.channelItemKey = data.configItemKey;
})
})
}
3.eventBus组件:
import Vue from 'vue'
/** * 定义空的vue实例,作为 eventbus实现非父子组件之间的通信(vue2.x中去掉了broadcast) */
var eventBus = new Vue({
});
export default eventBus;
版权声明
本文为[滴噶]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_50402587/article/details/109601770
边栏推荐
- 如何在Win10系统下统计某目录下所有文件的数量
- Informatics Aosai yibentong 1211: judge whether elements exist | openjudge 1.13 41: judge whether elements exist
- Tita performance treasure: eight mistakes made by managers in performance appraisal
- HLS / Chisel 实践CORDIC高性能计算复数平方根
- Variant quick platoon: find the largest number of top k
- 金九银十面试季,字节跳动面试题拿走不谢(附详细答案解析)
- 深度确定性策略梯度(DDPG)
- NFT难道只是一场“美丽的泡沫”?
- Copula函数初了解
- Unity 透视投影矩阵变换的可视化
猜你喜欢

tf.keras.layers.Embedding函数

提供4路E1业务口4路百兆隔离网络2M E1专网多业务PDH光端机

tf.keras.layers.MaxPooling?D函数

【软件测试】零基础一文看懂软件测试基础知识

16 way E1 optical transceiver + 4-way 100M Ethernet optical transceiver PDH optical transceiver 2m integrated service optical transceiver

汇编学习《汇编语言(第三版)》王爽著第三章学习

Rsync and inotify remote synchronization

Leetcode 111 Balanced binary tree (2022.04.21)

Airtest安装及介绍

PDH光端机光纤传输32路E1+4路100M百兆网络光端机2M多业务光端机
随机推荐
Variante rapide: trouver le nombre maximum de K premiers
pycharm终端pip安装Error: “pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
信息学奥赛一本通 1211:判断元素是否存在 | OpenJudge 1.13 41:判断元素是否存在
2-15 求组合数
国内云安全市场突破百亿元,未来发展趋势如何?
云计算学习1——OpenStack云计算安装部署步骤图文并茂(先电2.2)
pyqt5使用内置数据库sqllite
Is NFT just a beautiful foam?
【软件测试】零基础一文看懂软件测试基础知识
HLS / Chisel 实践CORDIC高性能计算复数平方根
动态规划--LC518.零钱兑换II
实验四、数据预处理
每个人都应该使用 OKR吗?
tf.keras.layers.Dense函数
【速领】电子工程师入门必备计算工具-方波电路辅助设计表格
Dynamic programming -- lc518 Change II
Dual optical port 1 + 1 backup 8-way E1 + 2-way Gigabit isolation network 4-way 100m isolation PDH optical transceiver
CAS:36530-06-0氯化硼亚酞菁|亚酞菁|氯化硼亚酞菁|二氯硼酞菁染料|氯化亚酞菁硼|BORONSUBPHTHALOCYANINECHLORIDE
PDH光端机综合多业务光接入设备双光口传16路E1 2M+4路千兆1000M网络+4路百兆共享网络机架式双电源
16路E1光端机+4路百兆以太网络光端机PDH光端机2M综合业务光端机