当前位置:网站首页>bus事件总线 使用
bus事件总线 使用
2022-08-10 10:07:00 【极端~】
- 路由
1)路由每个界面固定停留在相应的导航栏:在nav组件里加了一个bus事件总线
eventBus.js
import Vue from 'vue'
export default new Vue()
在navMain.vue中引入
import eventBus from "@/utils/eventBus.js"
created(){
eventBus.$on("message", data => {
console.log("A组件传给B组件的", data);
this.toggleNav(data)
});
其他界面要引用
import eventBus from "@/utils/eventBus.js"
let param = { id: 1, key: 'xxx', path:`/xxx`, name: 'xxx' }
eventBus.$emit("message", param)
边栏推荐
- Which is the strongest workflow engine for "Technology Selection"?Chief Architecture Helps You Pick
- Excel draws statistical graphs
- ESP8266-Arduino编程实例-MQ-8氢气传感器驱动
- Tencent releases the second-generation version of the quadruped robot Max, which completes jumps and somersaults on the plum blossom pile
- 因子分析(SPSS)
- ES复杂操作搜索
- SQL中的字符串截取函数
- WebView2 通过 PuppeteerSharp 实现爬取 王者 壁纸 (案例版)
- 解决问题目录
- 【知识论概念】《理由论的进展》鲁汶大学2022最新220页博士论文
猜你喜欢
String interception function in SQL
The Generation of Matlab Symbolic Functions and the Calculation of Its Function Values
支付 x 聚合 x 分账 - 回流平台“二清”风险规避之路
哈希表,哈希桶的实现
对话陈赐靓:哪吒要让高端产品大众化
Plot temperature curves; QChart,
[Concept of Theory of Knowledge] "Progress in the Theory of Reason" University of Leuven 2022 latest 220-page doctoral dissertation
Lasso回归(Stata)
[C language] Floating point number rounding
"Microservice Architecture" Arrangement and Choreography - Different Models for Making Systems Work Together
随机推荐
MySQL executes the query process
【物联网架构】最适合物联网的开源数据库
讯飞翻译机抢镜背后,跨语种沟通迈入全新时代
ZZULIOJ 1124: Merge two sorted arrays
因子分析(SPSS)
ESP8266 教程2 — 烧录AT固件
「业务架构」TOGAF建模:组织分解图(组织映射)
【C语言】头文件#include <conio.h>,conio是Console Input/Output(控制台输入输出)
14 high-frequency handwritten JS interview questions and answers to consolidate your JS foundation
[Internet of Things Architecture] The most suitable open source database for the Internet of Things
【Redis】Redis入门教程(介绍 下载安装 Jedis 图形化界面)
IDEA中xml文件头报错:URI is not registered (Settings | Languages & Frameworks | Schemas and DTDs)
LiveGBS操作日志页面快速的筛选上级平台的调用记录直播观看录像回看等操作
2022.8.9-----leetcode.1413
go web之cookie
vs2012创建WCF应用程序
Property animation QPropertyAnimation
C语言题解:倒置字符串
How to understand the difference between BIO, NIO, and AIO
ESP8266-Arduino编程实例-MQ-8氢气传感器驱动