修改:提取设置菜单
This commit is contained in:
parent
345be49633
commit
85ded1cdbf
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import { Icon } from 'ant-design-vue'
|
import { Icon } from 'ant-design-vue'
|
||||||
const IconFont = Icon.createFromIconfontCN({
|
const IconFont = Icon.createFromIconfontCN({
|
||||||
scriptUrl: '//at.alicdn.com/t/font_2024484_1hgvlgamz9c.js'
|
scriptUrl: '//at.alicdn.com/t/font_2024484_acokdskxqbj.js'
|
||||||
})
|
})
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="app-main">
|
<section class="app-main">
|
||||||
<transition name="fade-transform" mode="out-in">
|
<!-- <transition name="fade-transform" mode="out-in">-->
|
||||||
<keep-alive v-if="$route.meta.keepAlive">
|
<keep-alive v-if="$route.meta.keepAlive">
|
||||||
<router-view :key="key" />
|
<router-view :key="key" />
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
<router-view v-else :key="key" />
|
<router-view v-else :key="key" />
|
||||||
</transition>
|
<!-- </transition>-->
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -5,34 +5,34 @@
|
|||||||
|
|
||||||
<div class="right-content">
|
<div class="right-content">
|
||||||
|
|
||||||
<div>
|
<!-- <div>-->
|
||||||
<el-menu class="el-menu-demo" mode="horizontal">
|
<!-- <el-menu class="el-menu-demo" mode="horizontal">-->
|
||||||
<el-menu-item index="1" href="/setting/manager-categories">
|
<!-- <el-menu-item index="1" href="/setting/manager-categories">-->
|
||||||
<router-link to="/setting/manager-cloud">
|
<!-- <router-link to="/setting/manager-cloud">-->
|
||||||
网盘管理
|
<!-- 网盘管理-->
|
||||||
</router-link>
|
<!-- </router-link>-->
|
||||||
</el-menu-item>
|
<!-- </el-menu-item>-->
|
||||||
<el-submenu index="2">
|
<!-- <el-submenu index="2">-->
|
||||||
<template slot="title">管理</template>
|
<!-- <template slot="title">管理</template>-->
|
||||||
<el-menu-item index="2-0">
|
<!-- <el-menu-item index="2-0">-->
|
||||||
<router-link to="/setting/manager-blog">
|
<!-- <router-link to="/setting/manager-blog">-->
|
||||||
<svg-icon icon-class="blogger"></svg-icon>
|
<!-- <svg-icon icon-class="blogger"></svg-icon>-->
|
||||||
博客管理
|
<!-- 博客管理-->
|
||||||
</router-link>
|
<!-- </router-link>-->
|
||||||
</el-menu-item>
|
<!-- </el-menu-item>-->
|
||||||
<el-menu-item index="2-1">
|
<!-- <el-menu-item index="2-1">-->
|
||||||
<router-link to="/setting/manager-categories">
|
<!-- <router-link to="/setting/manager-categories">-->
|
||||||
<svg-icon icon-class="leimupinleifenleileibie"></svg-icon>
|
<!-- <svg-icon icon-class="leimupinleifenleileibie"></svg-icon>-->
|
||||||
分类管理
|
<!-- 分类管理-->
|
||||||
</router-link>
|
<!-- </router-link>-->
|
||||||
</el-menu-item>
|
<!-- </el-menu-item>-->
|
||||||
<el-menu-item index="2-2">
|
<!-- <el-menu-item index="2-2">-->
|
||||||
<svg-icon icon-class="biaoqian"></svg-icon>
|
<!-- <svg-icon icon-class="biaoqian"></svg-icon>-->
|
||||||
标签管理
|
<!-- 标签管理-->
|
||||||
</el-menu-item>
|
<!-- </el-menu-item>-->
|
||||||
</el-submenu>
|
<!-- </el-submenu>-->
|
||||||
</el-menu>
|
<!-- </el-menu>-->
|
||||||
</div>
|
<!-- </div>-->
|
||||||
|
|
||||||
<div class="right-username">{{username}}</div>
|
<div class="right-username">{{username}}</div>
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||||
<router-link to="/setting/user">
|
<router-link to="/setting/user">
|
||||||
<el-dropdown-item>
|
<el-dropdown-item>
|
||||||
<i class="el-icon-setting" />个人信息
|
<i class="el-icon-setting" />设置
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
<!--<router-link to="/">-->
|
<!--<router-link to="/">-->
|
||||||
|
|||||||
@ -31,7 +31,21 @@ export default {
|
|||||||
'sidebar'
|
'sidebar'
|
||||||
]),
|
]),
|
||||||
routes() {
|
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() {
|
activeMenu() {
|
||||||
const route = this.$route
|
const route = this.$route
|
||||||
|
|||||||
@ -152,19 +152,19 @@ export const constantRoutes = [
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
// {
|
||||||
path: '/setting/user',
|
// path: '/setting/user',
|
||||||
component: Layout,
|
// component: Layout,
|
||||||
children: [
|
// children: [
|
||||||
{
|
// {
|
||||||
path: '',
|
// path: '',
|
||||||
name: 'setting-user',
|
// name: 'setting-user',
|
||||||
component: () => import('@/views/setting/user/index'),
|
// component: () => import('@/views/setting/user/index'),
|
||||||
meta: { title: '设置' },
|
// meta: { title: '设置' },
|
||||||
hidden: true
|
// hidden: true
|
||||||
}
|
// }
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// path: '/demo',
|
// path: '/demo',
|
||||||
@ -187,7 +187,7 @@ export const constantRoutes = [
|
|||||||
path: 'editor',
|
path: 'editor',
|
||||||
name: 'markdown',
|
name: 'markdown',
|
||||||
component: () => import('@/views/markdown/index'),
|
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',
|
path: '/setting/manager-categories',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'manager-categories',
|
name: 'manager-categories',
|
||||||
component: () => import('@/views/setting/articles/categoryManager'),
|
component: () => import('@/views/setting/articles/categoryManager'),
|
||||||
meta: { title: '分类管理', icon: 'md-list' }
|
meta: { title: '分类管理', icon: 'leimupinleifenleileibie' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/setting/manager-blog',
|
path: '/setting/manager-blog',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'manager-blog',
|
name: 'manager-blog',
|
||||||
component: () => import('@/views/setting/articles/blogManager'),
|
component: () => import('@/views/setting/articles/blogManager'),
|
||||||
meta: { title: '博客管理' }
|
meta: { title: '博客管理' , icon: 'blogger'}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/setting/manager-cloud',
|
path: '/setting/manager-cloud',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
name: 'manager-cloud',
|
name: 'manager-cloud',
|
||||||
component: () => import('@/views/setting/cloudManager'),
|
component: () => import('@/views/setting/cloudManager'),
|
||||||
meta: { title: '网盘管理', icon: 'md-list' }
|
meta: { title: '网盘管理', icon: 'yunshezhi' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/articles',
|
path: '/articles',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user