format code

This commit is contained in:
Pan
2018-08-15 17:29:15 +08:00
parent 93e01b64d4
commit 53f3e7d5e6
13 changed files with 503 additions and 227 deletions

View File

@@ -6,9 +6,11 @@ const tagsView = {
mutations: {
ADD_VISITED_VIEWS: (state, view) => {
if (state.visitedViews.some(v => v.path === view.path)) return
state.visitedViews.push(Object.assign({}, view, {
title: view.meta.title || 'no-name'
}))
state.visitedViews.push(
Object.assign({}, view, {
title: view.meta.title || 'no-name'
})
)
if (!view.meta.noCache) {
state.cachedViews.push(view.name)
}
@@ -43,7 +45,7 @@ const tagsView = {
}
}
},
DEL_ALL_VIEWS: (state) => {
DEL_ALL_VIEWS: state => {
state.visitedViews = []
state.cachedViews = []
}
@@ -53,19 +55,19 @@ const tagsView = {
commit('ADD_VISITED_VIEWS', view)
},
delVisitedViews({ commit, state }, view) {
return new Promise((resolve) => {
return new Promise(resolve => {
commit('DEL_VISITED_VIEWS', view)
resolve([...state.visitedViews])
})
},
delOthersViews({ commit, state }, view) {
return new Promise((resolve) => {
return new Promise(resolve => {
commit('DEL_OTHERS_VIEWS', view)
resolve([...state.visitedViews])
})
},
delAllViews({ commit, state }) {
return new Promise((resolve) => {
return new Promise(resolve => {
commit('DEL_ALL_VIEWS')
resolve([...state.visitedViews])
})