vue elementUI使用tabs与导航栏联动

不使用tabs标签页时,点击导航菜单,router-view映射相应的组件即可显示页面。但我们想在点击导航栏时在tabs中映射相应的组件,这就需要使用tabs组件
在slider.vue中点击路由后,把当前选择的路由@select使用bus传出去



		
			

		

使用bus把路由信息传出

import bus from '../common/bus';
methods: {
	addTab(key,keyPath) {
		console.log(key,keyPath)
		bus.$emit('navPath',keyPath)
	}
},

在tabs.vue中接收






你可能感兴趣的:(elementUI)