diff --git a/src/components/editor/editor.vue b/src/components/editor/editor.vue index 881c73eda..3d2a3b6cb 100644 --- a/src/components/editor/editor.vue +++ b/src/components/editor/editor.vue @@ -69,7 +69,7 @@ export default { diff --git a/src/store/module/app.js b/src/store/module/app.js index d4b87724b..ffe449ba7 100644 --- a/src/store/module/app.js +++ b/src/store/module/app.js @@ -65,11 +65,25 @@ export default { if (!route) return closePage(state, route) }, + // addTag (state, { route, type = 'unshift' }) { + // let router = getRouteTitleHandled(route) + // if (!routeHasExist(state.tagNavList, router)) { + // if (type === 'push') state.tagNavList.push(router) + // else { + // if (router.name === homeName) state.tagNavList.unshift(router) + // else state.tagNavList.splice(1, 0, router) + // } + // setTagNavListInLocalstorage([...state.tagNavList]) + // } + // }, + addTag (state, { route, type = 'unshift' }) { let router = getRouteTitleHandled(route) if (!routeHasExist(state.tagNavList, router)) { - if (type === 'push') state.tagNavList.push(router) - else { + if (type === 'push') { + state.tagNavList = state.tagNavList.filter(d => d.name !== router.name) + state.tagNavList.push(router) + } else { if (router.name === homeName) state.tagNavList.unshift(router) else state.tagNavList.splice(1, 0, router) } diff --git a/vue.config.js b/vue.config.js index 5d6c1d405..c5581641b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -28,7 +28,7 @@ module.exports = { // tweak internal webpack configuration. // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md // 如果你不需要使用eslint,把lintOnSave设为false即可 - lintOnSave: true, + lintOnSave: false, chainWebpack: config => { config.resolve.alias .set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))