feat: 调整一级菜单
This commit is contained in:
parent
ef5eab2e19
commit
d28a69e056
@ -3,7 +3,7 @@
|
||||
<transition-group name="breadcrumb">
|
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
||||
<span v-if="index === 0">当前位置:</span>
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{item.meta.title }}</span>
|
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
|
||||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
|
||||
</el-breadcrumb-item>
|
||||
</transition-group>
|
||||
@ -34,7 +34,7 @@ export default {
|
||||
const first = matched[0]
|
||||
|
||||
if (!this.isDashboard(first)) {
|
||||
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
|
||||
matched = [{ path: '/panel', meta: { title: '仪表板' }}].concat(matched)
|
||||
}
|
||||
|
||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
|
||||
@ -44,7 +44,8 @@ export default {
|
||||
if (!name) {
|
||||
return false
|
||||
}
|
||||
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
|
||||
// return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
|
||||
return name.trim().toLocaleLowerCase() === '仪表板'.toLocaleLowerCase()
|
||||
},
|
||||
pathCompile(path) {
|
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
||||
|
||||
@ -56,6 +56,7 @@ import { post } from '@/api/panel/panel'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
export default {
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
components: { PreviewEject },
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -94,7 +94,7 @@ export default {
|
||||
return meta.activeMenu
|
||||
}
|
||||
// 如果是首页,首页高亮
|
||||
if (path === '/dashboard') {
|
||||
if (path === '/panel') {
|
||||
return '/'
|
||||
}
|
||||
// 如果不是首页,高亮一级菜单
|
||||
|
||||
@ -82,19 +82,25 @@ export const constantRoutes = [
|
||||
component: () => import('@/components/canvas/components/Editor/PreviewFullScreen'),
|
||||
hidden: true
|
||||
},
|
||||
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: '/dashboard',
|
||||
children: [{
|
||||
path: 'dashboard',
|
||||
name: 'Dashboard',
|
||||
component: () => import('@/views/dashboard/index'),
|
||||
meta: { title: '首页', icon: 'dashboard' }
|
||||
}]
|
||||
redirect: '/panel',
|
||||
hidden: true
|
||||
}
|
||||
|
||||
// {
|
||||
// path: '/',
|
||||
// component: Layout,
|
||||
// redirect: '/panel',
|
||||
// children: [{
|
||||
// path: 'index',
|
||||
// name: '仪表板',
|
||||
// component: () => import('@/views/panel/index'),
|
||||
// meta: { title: '仪表板', icon: 'dashboard' }
|
||||
// }]
|
||||
// }
|
||||
|
||||
// {
|
||||
// path: '/example',
|
||||
// component: Layout,
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<ul class="list-unstyled">
|
||||
<li>或者你可以去:</li>
|
||||
<li class="link-type">
|
||||
<router-link to="/dashboard">
|
||||
<router-link to="/panel">
|
||||
回首页
|
||||
</router-link>
|
||||
</li>
|
||||
@ -39,7 +39,7 @@ export default {
|
||||
methods: {
|
||||
back() {
|
||||
if (this.$route.query.noGoBack) {
|
||||
this.$router.push({ path: '/dashboard' })
|
||||
this.$router.push({ path: '/panel' })
|
||||
} else {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user