添加中间件

This commit is contained in:
952108534@qq.com
2022-01-10 11:09:10 +08:00
parent f1b7b7c501
commit 8d00674559
6 changed files with 56 additions and 528 deletions

41
rc-busness/store/tab.js Normal file
View File

@@ -0,0 +1,41 @@
const state={
currentMenu: null,
tabsList: [{
path: '/',
name: 'index',
title: '首页',
}],
usershow:[],
}
const mutations={
usermenu(state,val){
let usershow=[];
state.usershow.push(val);
console.log(state);
},
//选择标签 选择面包屑
selectMenu(state, val) {
console.log(state,val);
if (val.name === 'index') {
state.currentMenu = null
} else {
state.currentMenu = val
//如果等于-1说明tabsList不存在那么插入否则什么都不做
let result = state.tabsList.findIndex(item => item.name === val.name)
result === -1 ? state.tabsList.push(val) : ''
}
},
AllClose(state) {
state.tabsList = [{
path: '/',
name: 'index',
label: '首页',
}]
}
}