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.
22 lines
439 B
22 lines
439 B
1 year ago
|
const state = {
|
||
|
recentPages: []
|
||
|
}
|
||
|
|
||
|
const mutations = {
|
||
|
|
||
|
addRecent(state, item) {
|
||
|
if (state.recentPages.find(unit => unit.path == item.path)) return;
|
||
|
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,
|
||
|
}
|