提交 d28a69e0 authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

feat: 调整一级菜单

上级 ef5eab2e
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<transition-group name="breadcrumb"> <transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="index === 0">当前位置:</span> <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> <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item> </el-breadcrumb-item>
</transition-group> </transition-group>
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
const first = matched[0] const first = matched[0]
if (!this.isDashboard(first)) { 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) this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
...@@ -44,7 +44,8 @@ export default { ...@@ -44,7 +44,8 @@ export default {
if (!name) { if (!name) {
return false return false
} }
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase() // return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
return name.trim().toLocaleLowerCase() === '仪表板'.toLocaleLowerCase()
}, },
pathCompile(path) { pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 // To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
......
...@@ -56,6 +56,7 @@ import { post } from '@/api/panel/panel' ...@@ -56,6 +56,7 @@ import { post } from '@/api/panel/panel'
import bus from '@/utils/bus' import bus from '@/utils/bus'
export default { export default {
// eslint-disable-next-line vue/no-unused-components
components: { PreviewEject }, components: { PreviewEject },
data() { data() {
return { return {
......
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
return meta.activeMenu return meta.activeMenu
} }
// 如果是首页,首页高亮 // 如果是首页,首页高亮
if (path === '/dashboard') { if (path === '/panel') {
return '/' return '/'
} }
// 如果不是首页,高亮一级菜单 // 如果不是首页,高亮一级菜单
......
...@@ -82,19 +82,25 @@ export const constantRoutes = [ ...@@ -82,19 +82,25 @@ export const constantRoutes = [
component: () => import('@/components/canvas/components/Editor/PreviewFullScreen'), component: () => import('@/components/canvas/components/Editor/PreviewFullScreen'),
hidden: true hidden: true
}, },
{ {
path: '/', path: '/',
component: Layout, component: Layout,
redirect: '/dashboard', redirect: '/panel',
children: [{ hidden: true
path: 'dashboard',
name: 'Dashboard',
component: () => import('@/views/dashboard/index'),
meta: { title: '首页', icon: 'dashboard' }
}]
} }
// {
// path: '/',
// component: Layout,
// redirect: '/panel',
// children: [{
// path: 'index',
// name: '仪表板',
// component: () => import('@/views/panel/index'),
// meta: { title: '仪表板', icon: 'dashboard' }
// }]
// }
// { // {
// path: '/example', // path: '/example',
// component: Layout, // component: Layout,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
<li>或者你可以去:</li> <li>或者你可以去:</li>
<li class="link-type"> <li class="link-type">
<router-link to="/dashboard"> <router-link to="/panel">
回首页 回首页
</router-link> </router-link>
</li> </li>
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
methods: { methods: {
back() { back() {
if (this.$route.query.noGoBack) { if (this.$route.query.noGoBack) {
this.$router.push({ path: '/dashboard' }) this.$router.push({ path: '/panel' })
} else { } else {
this.$router.go(-1) this.$router.go(-1)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论