From 6a5a42605765af948ef0876aa444acb6b0bf44aa Mon Sep 17 00:00:00 2001 From: huzhushan Date: Wed, 28 Apr 2021 17:48:59 +0800 Subject: [PATCH] =?UTF-8?q?bug=20fix:=20=E4=BF=AE=E5=A4=8D=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=8A=A8=E6=80=81=E8=B7=AF=E7=94=B1=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E7=9A=84=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/test.js | 13 ++++++++++++- src/store/modules/tags.js | 10 +++++----- src/views/test/Edit.vue | 39 ++++++++++++++++++++++++++++++++++++++ src/views/test/index.vue | 8 +++++++- 4 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 src/views/test/Edit.vue diff --git a/src/router/modules/test.js b/src/router/modules/test.js index 8010804..6192c45 100644 --- a/src/router/modules/test.js +++ b/src/router/modules/test.js @@ -3,7 +3,7 @@ * @version: * @Date: 2021-04-21 09:18:32 * @LastEditors: huzhushan@126.com - * @LastEditTime: 2021-04-23 10:49:35 + * @LastEditTime: 2021-04-28 16:49:53 * @Author: huzhushan@126.com * @HomePage: https://huzhushan.gitee.io/vue3-element-admin * @Github: https://github.com/huzhushan/vue3-element-admin @@ -12,6 +12,7 @@ const Layout = () => import('@/layout/index.vue') const List = () => import('@/views/test/index.vue') const Add = () => import('@/views/test/Add.vue') +const Edit = () => import('@/views/test/Edit.vue') const Auth = () => import('@/views/test/Auth.vue') const NoAuth = () => import('@/views/test/NoAuth.vue') const Nest = () => import('@/views/test/Nest.vue') @@ -51,6 +52,16 @@ export default [ }, hidden: true, // 不在菜单中显示 }, + { + path: 'edit/:id', + name: 'testEdit', + component: Edit, + meta: { + title: '编辑', + roles: ['admin', 'visitor'], + }, + hidden: true, // 不在菜单中显示 + }, { path: 'auth', name: 'testAuth', diff --git a/src/store/modules/tags.js b/src/store/modules/tags.js index ef90188..c461334 100644 --- a/src/store/modules/tags.js +++ b/src/store/modules/tags.js @@ -3,7 +3,7 @@ * @version: * @Date: 2021-04-20 11:06:21 * @LastEditors: huzhushan@126.com - * @LastEditTime: 2021-04-21 09:34:20 + * @LastEditTime: 2021-04-28 17:40:11 * @Author: huzhushan@126.com * @HomePage: https://huzhushan.gitee.io/vue3-element-admin * @Github: https://github.com/huzhushan/vue3-element-admin @@ -20,7 +20,7 @@ const state = { } const mutations = { - ADD_TAG_LIST: (state, { path, fullPath, name, meta }) => { + ADD_TAG_LIST: (state, { path, fullPath, name, meta, params, query }) => { if (state.tagList.some(v => v.path === path)) return false state.tagList.splice( @@ -28,7 +28,7 @@ const mutations = { 0, Object.assign( {}, - { path, fullPath, name, meta }, + { path, fullPath, name, meta, params, query }, { title: meta.title || '未命名', fullPath: fullPath || path, @@ -156,8 +156,8 @@ const actions = { commit('DEL_ALL_CACHE_LIST') }, - updateTagList({ commit }, tag) { - commit('UPDATE_TAG_LIST', tag) + updateTagList({ commit }, { path, fullPath, name, meta, params, query }) { + commit('UPDATE_TAG_LIST', { path, fullPath, name, meta, params, query }) }, } diff --git a/src/views/test/Edit.vue b/src/views/test/Edit.vue new file mode 100644 index 0000000..cc559d8 --- /dev/null +++ b/src/views/test/Edit.vue @@ -0,0 +1,39 @@ + + + diff --git a/src/views/test/index.vue b/src/views/test/index.vue index 393dd38..c331dee 100644 --- a/src/views/test/index.vue +++ b/src/views/test/index.vue @@ -25,7 +25,13 @@