From 4d3bbae183a7c88000ed75770d6ca9b0ee6b0c55 Mon Sep 17 00:00:00 2001 From: Pan Date: Wed, 13 Dec 2017 18:33:12 +0800 Subject: [PATCH] perf[tags-view]:refine the style && format code --- src/store/modules/tagsView.js | 10 +- src/views/layout/components/TagsView.vue | 336 ++++++++++++----------- 2 files changed, 174 insertions(+), 172 deletions(-) diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index 1fccaf69..273d33bd 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -30,17 +30,17 @@ const tagsView = { } } }, - DEL_OTHER_VIEWS: (state, view) => { + DEL_OTHERS_VIEWS: (state, view) => { for (const [i, v] of state.visitedViews.entries()) { if (v.path === view.path) { - state.visitedViews = [].concat(state.visitedViews.slice(i, i + 1)) + state.visitedViews = state.visitedViews.slice(i, i + 1) break } } for (const i of state.cachedViews) { if (i === view.name) { const index = state.cachedViews.indexOf(i) - state.cachedViews = [].concat(state.cachedViews.slice(index, i + 1)) + state.cachedViews = state.cachedViews.slice(index, i + 1) break } } @@ -60,9 +60,9 @@ const tagsView = { resolve([...state.visitedViews]) }) }, - delOtherViews({ commit, state }, view) { + delOthersViews({ commit, state }, view) { return new Promise((resolve) => { - commit('DEL_OTHER_VIEWS', view) + commit('DEL_OTHERS_VIEWS', view) resolve([...state.visitedViews]) }) }, diff --git a/src/views/layout/components/TagsView.vue b/src/views/layout/components/TagsView.vue index 018e8d47..38a906a0 100644 --- a/src/views/layout/components/TagsView.vue +++ b/src/views/layout/components/TagsView.vue @@ -1,199 +1,201 @@