From 58c1c7e7059d9be8b4dc17c65a43393534dd2073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8A=9B?= Date: Wed, 20 Oct 2021 11:21:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E8=81=94=E5=8A=A8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/AppMain.vue | 33 ++ src/layout/components/Sidebar/SidebarItem.vue | 15 +- src/layout/components/TagsView/ScrollPane.vue | 81 +++++ src/layout/components/TagsView/index.vue | 285 ++++++++++++++++++ src/layout/components/Topbar.vue | 2 +- src/store/modules/permission.js | 9 +- 6 files changed, 421 insertions(+), 4 deletions(-) create mode 100644 src/layout/components/TagsView/ScrollPane.vue create mode 100644 src/layout/components/TagsView/index.vue diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 156150d..4fd7590 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -21,3 +21,36 @@ export default { } } + + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue index e836529..59c736e 100644 --- a/src/layout/components/Sidebar/SidebarItem.vue +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -20,10 +20,17 @@ + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..c31f0c3 --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,285 @@ + + + + + + + diff --git a/src/layout/components/Topbar.vue b/src/layout/components/Topbar.vue index 6386335..69675d4 100644 --- a/src/layout/components/Topbar.vue +++ b/src/layout/components/Topbar.vue @@ -174,7 +174,7 @@ export default { handleSelect(key, keyPath) { // 把选中路由的子路由保存store const route = this.routes.find(item => item.path === key) - this.$store.commit('permission/SET_CURRENT_ROUTES', route) + this.$store.commit('SET_CURRENT_ROUTES', route) this.setSidebarHide(route) }, // 设置侧边栏的显示和隐藏 diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 70ed46a..27e4868 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -8,7 +8,8 @@ const permission = { routers: constantRouterMap, addRouters: [], sidebarRouters: [], - navMenus: [] + navMenus: [], + currentRoutes: {} }, // 同步更改状态 mutations: { @@ -21,6 +22,9 @@ const permission = { }, SET_NAV_MENUS: (state, routers) => { state.navMenus = routers + }, + SET_CURRENT_ROUTES: (state, routers) => { + state.currentRoutes = routers } }, // 发送异步请求拿到数据 @@ -34,6 +38,9 @@ const permission = { SetNavMenus({ commit }, sidebarRouter) { commit('SET_NAV_MENUS', sidebarRouter) } + // SetCurrentRoutes({ commit }, routes) { + // commit('SET_CURRENT_ROUTES', routes) + // } } }