当前位置:网站首页>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)
边栏推荐
- VBA:获取指定数值在指定一维数组中的位置
- 「业务架构」TAGAF建模:业务服务/信息图
- 数据库中的schema
- Techches Transformer the join wisdom source the author cao, visual basic model study
- 傅立叶级数与傅里叶变换
- Excel绘制统计图
- ES复杂操作搜索
- [Concept of Theory of Knowledge] "Progress in the Theory of Reason" University of Leuven 2022 latest 220-page doctoral dissertation
- 负载均衡原理分析与源码解读
- 在兄弟连战狼班参加PHP培训做行业领先人才
猜你喜欢
Excel draws statistical graphs
[Internet of Things Architecture] The most suitable open source database for the Internet of Things
WebView2 通过 PuppeteerSharp 实现爬取 王者 壁纸 (案例版)
Dalian University of Technology & Pengcheng & UAE propose a mixed-scale triple network ZoomNet for camouflaged target detection, with SOTA performance!
Tencent releases the second-generation version of the quadruped robot Max, which completes jumps and somersaults on the plum blossom pile
CentOS和Ubantu的Mysql主从配置
Fourier series and Fourier transform
ESP8266 教程2 — 烧录AT固件
Swin Transformer作者曹越加入智源,开展视觉基础模型研究
在“企业通讯录”的盲区,融云的边界与分寸
随机推荐
「业务架构」TOGAF建模:业务功能分解图
PTA 7-2 Summation and Counting of Diagonal Elements of Square Matrices Solution
Development environment variable record under win
武功修炼:招式
腾讯云校园大使开始招募啦,内推名额和奖金等你来拿
lua初学
ES关于文档的基本操作
态势丨黑客侵扰加剧,靶场为网络安全架设“防御盾”
「时序数据库」使用cassandra进行时间序列数据扫描
解决ASP.NET Core在Task中使用IServiceProvider的问题
序列化技术ProtoBuf
2022.8.9-----leetcode.1413
定时任务Quartz
LiveNVR操作日志页面快速筛选上级国标平台的调用记录直播观看录像回看等操作
The web project accesses static resources inside the reference jar
Tencent releases the second-generation version of the quadruped robot Max, which completes jumps and somersaults on the plum blossom pile
【知识论概念】《理由论的进展》鲁汶大学2022最新220页博士论文
数据库的约束
Message Queuing Overview
「应用架构」TOGAF建模:应用程序迁移图