const mutations = {
EDIT_VISITED_VIEWS: (state, view) => {
for (var Index in state.visitedViews) {
console.log(state.visitedViews[Index].path)
if (state.visitedViews[Index].path == view.path) {
state.visitedViews[Index].title = view.meta.title
}
}
},
}
const actions = {
editVisitedViews({ commit, state }, view) {
return new Promise((resolve) => {
commit('EDIT_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
}
this.$route.meta.title = '随机名字'
this.$store.dispatch('tagsView/editVisitedViews', this.$route)