王多静

这里是我的记事本

导航

vue-element-admin只有1个二级导航时也要展示

问题: 默认情况下,一级导航下面只有1个二级导航的时候, 一级导航会不做显示, 仅展示二级导航.

需求: 一级导航和二级导航都展示, 如下面右图

 

 

仅需要在路由写上这行就行 

alwaysShow: true,
// 全部是这样
{ path: "/management", component: Layout, redirect: "/management/toPayOrder", name: "OrderManagement", alwaysShow: true, // 就是这行显隐起作用的 meta: { title: "管理", icon: "el-icon-s-grid" }, children: [ { path: "toPayOrder", name: "ToPayOrder", component: () => import("@/views/management/toPayOrder"), meta: { title: "财务订单", icon: "el-icon-menu" }, hidden: false }, { path: "toPayOrderDetail", name: "ToPayOrderDetail", component: () => import("@/views/management/detail/orderDetail"), meta: { title: "详情" }, hidden: true } ] },

 

官网链接

 

posted on 2020-12-11 14:26  王多静  阅读(883)  评论(0编辑  收藏  举报