From 85ded1cdbf7195331466f220fb9ce8d1f2102c6c Mon Sep 17 00:00:00 2001 From: jmal Date: Wed, 11 Nov 2020 17:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Icon/Icon.vue | 2 +- src/layout/components/AppMain.vue | 4 +- src/layout/components/Navbar.vue | 58 ++++++++++++------------- src/layout/components/Sidebar/index.vue | 16 ++++++- src/router/index.js | 50 ++++++++++++--------- 5 files changed, 76 insertions(+), 54 deletions(-) diff --git a/src/components/Icon/Icon.vue b/src/components/Icon/Icon.vue index 0c40473..a0e2747 100644 --- a/src/components/Icon/Icon.vue +++ b/src/components/Icon/Icon.vue @@ -5,7 +5,7 @@ import { Icon } from 'ant-design-vue' const IconFont = Icon.createFromIconfontCN({ - scriptUrl: '//at.alicdn.com/t/font_2024484_1hgvlgamz9c.js' + scriptUrl: '//at.alicdn.com/t/font_2024484_acokdskxqbj.js' }) export default { diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 019c1e0..dc848e3 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -1,11 +1,11 @@ diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 5f10e7b..dee7162 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -5,34 +5,34 @@
-
- - - - 网盘管理 - - - - - - - - 博客管理 - - - - - - 分类管理 - - - - - 标签管理 - - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{username}}
@@ -45,7 +45,7 @@ - 个人信息 + 设置 diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue index da39034..ca1804f 100644 --- a/src/layout/components/Sidebar/index.vue +++ b/src/layout/components/Sidebar/index.vue @@ -31,7 +31,21 @@ export default { 'sidebar' ]), routes() { - return this.$router.options.routes + let routes = [] + if(this.$route.path.startsWith("/setting")){ + this.$router.options.routes.forEach(route => { + if(route.path.startsWith("/setting")){ + routes.push(route) + } + }) + } else { + this.$router.options.routes.forEach(route => { + if(!route.path.startsWith("/setting")){ + routes.push(route) + } + }) + } + return routes }, activeMenu() { const route = this.$route diff --git a/src/router/index.js b/src/router/index.js index 058e2c1..b0ae82a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -152,19 +152,19 @@ export const constantRoutes = [ ] }, - { - path: '/setting/user', - component: Layout, - children: [ - { - path: '', - name: 'setting-user', - component: () => import('@/views/setting/user/index'), - meta: { title: '设置' }, - hidden: true - } - ] - }, + // { + // path: '/setting/user', + // component: Layout, + // children: [ + // { + // path: '', + // name: 'setting-user', + // component: () => import('@/views/setting/user/index'), + // meta: { title: '设置' }, + // hidden: true + // } + // ] + // }, // { // path: '/demo', @@ -187,7 +187,7 @@ export const constantRoutes = [ path: 'editor', name: 'markdown', component: () => import('@/views/markdown/index'), - // meta: { title: '创建文档', icon: 'md' } + meta: { title: '创建文档', icon: 'md' } } ] }, @@ -215,49 +215,57 @@ export const constantRoutes = [ } ] }, + { + path: '/setting/user', + component: Layout, + children: [ + { + path: '', + name: 'setting-user', + component: () => import('@/views/setting/user/index'), + meta: { title: '个人信息' , icon: 'UserSettings'} + } + ] + }, { path: '/setting/manager-categories', component: Layout, - hidden: true, children: [ { path: '', name: 'manager-categories', component: () => import('@/views/setting/articles/categoryManager'), - meta: { title: '分类管理', icon: 'md-list' } + meta: { title: '分类管理', icon: 'leimupinleifenleileibie' } } ] }, { path: '/setting/manager-blog', component: Layout, - hidden: true, children: [ { path: '', name: 'manager-blog', component: () => import('@/views/setting/articles/blogManager'), - meta: { title: '博客管理' } + meta: { title: '博客管理' , icon: 'blogger'} } ] }, { path: '/setting/manager-cloud', component: Layout, - hidden: true, children: [ { path: '', name: 'manager-cloud', component: () => import('@/views/setting/cloudManager'), - meta: { title: '网盘管理', icon: 'md-list' } + meta: { title: '网盘管理', icon: 'yunshezhi' } } ] }, { path: '/articles', component: Layout, - hidden: true, children: [ { path: '',