Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

稍微修改了下菜单的显示问题,和路由写法保持一致 #712

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/layout/components/Sidebar/SidebarItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export default {
}
})

// When there is only one child router, the child router is displayed by default
if (showingChildren.length === 1) {
return true
}


// Show parent if there are no child router to display
if (showingChildren.length === 0) {
Expand Down
6 changes: 6 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export const constantRoutes = [
path: '/',
component: Layout,
redirect: '/dashboard',
name: 'FatherDashboard',
meta: {title: 'FatherDashboard', icon: 'dashboard'},
children: [{
path: 'dashboard',
name: 'Dashboard',
Expand Down Expand Up @@ -80,6 +82,8 @@ export const constantRoutes = [
{
path: '/form',
component: Layout,
name: 'FatherForm',
meta: {title: 'FatherForm', icon: 'form'},
children: [
{
path: 'index',
Expand Down Expand Up @@ -152,6 +156,8 @@ export const constantRoutes = [
{
path: 'external-link',
component: Layout,
name: 'father-external-link',
meta: { title: 'F External Link', icon: 'link' },
children: [
{
path: 'https://panjiachen.github.io/vue-element-admin-site/#/',
Expand Down