feat: 调整一级菜单

This commit is contained in:
fit2cloud-chenyw 2021-04-22 17:59:16 +08:00
parent ef5eab2e19
commit d28a69e056
5 changed files with 22 additions and 14 deletions

View File

@ -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

View File

@ -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 {

View File

@ -94,7 +94,7 @@ export default {
return meta.activeMenu
}
//
if (path === '/dashboard') {
if (path === '/panel') {
return '/'
}
//

View File

@ -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,

View File

@ -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)
}