济菏高速业务端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
642 B

const state = {
recentPages: []
}
const mutations = {
addRecent(state, item) {
let temp;
state.recentPages.forEach((unit,index)=>{
if(unit.path == item.path){
temp = unit;
temp.active = true;
}else{
unit.active = false;
}
});
if (!temp){
item.active = true;
state.recentPages.push(item);
}
},
removeRecent(state, item) {
let i = state.recentPages.findIndex(unit => unit.path == item.path);
state.recentPages.splice(i, 1);
}
}
export default {
namespaced: true,
state,
mutations,
}