移除菜单中的alwaysShow配置项

master
toesbieya 5 years ago
parent ad978c46dc
commit ba09169f4b
  1. 2
      vue/full/src/router/module/admin/child/message.js
  2. 2
      vue/full/src/router/module/admin/child/purchase.js
  3. 2
      vue/full/src/router/module/admin/child/sell.js
  4. 2
      vue/full/src/router/module/admin/child/stock.js
  5. 2
      vue/full/src/router/module/admin/child/system.js
  6. 2
      vue/full/src/router/module/dev/index.js
  7. 4
      vue/full/src/store/module/resource.js
  8. 1
      vue/full/src/view/admin/system/menu/indexPage.vue

@ -2,7 +2,7 @@
const router = {
path: 'message',
meta: {title: '消息中心', icon: 'svg-message', alwaysShow: true},
meta: {title: '消息中心', icon: 'svg-message'},
children: [
{
path: 'manage',

@ -2,7 +2,7 @@
const router = {
path: 'purchase',
meta: {title: '采购管理', icon: 'svg-shopping', alwaysShow: true},
meta: {title: '采购管理', icon: 'svg-shopping'},
children: [
{
path: 'order',

@ -2,7 +2,7 @@
const router = {
path: 'sell',
meta: {title: '销售管理', icon: 'svg-sell', alwaysShow: true},
meta: {title: '销售管理', icon: 'svg-sell'},
children: [
{
path: 'order',

@ -2,7 +2,7 @@
const router = {
path: 'stock',
meta: {title: '库存管理', icon: 'svg-stock', alwaysShow: true},
meta: {title: '库存管理', icon: 'svg-stock'},
children: [
{
path: 'current',

@ -2,7 +2,7 @@
const router = {
path: 'system',
meta: {title: '系统管理', icon: 'svg-system', alwaysShow: true},
meta: {title: '系统管理', icon: 'svg-system'},
children: [
{
path: 'department',

@ -4,5 +4,5 @@ import component from "@/view/dev"
export default {
path: '/dev',
component,
meta: {title: '开发专用页面', icon: 'svg-develop', noAuth: true, noCache: true, alwaysShow: true}
meta: {title: '开发专用页面', icon: 'svg-develop', noAuth: true, noCache: true}
}

@ -104,7 +104,7 @@ function getAuthorizedMenus(menus) {
//删除不显示的菜单(没有children且没有meta.title)
function clean(menus) {
for (let i = menus.length - 1; i >= 0; i--) {
const {children = [], meta: {title, alwaysShow, hidden} = {}} = menus[i]
const {children = [], meta: {title, hidden} = {}} = menus[i]
if (hidden) {
menus.splice(i, 1)
@ -120,7 +120,7 @@ function getAuthorizedMenus(menus) {
clean(children)
if (children.length === 0 && !alwaysShow) {
if (children.length === 0) {
menus.splice(i, 1)
}

@ -193,7 +193,6 @@ export default {
title: null,
dynamicTitle: null,
hidden: false,
alwaysShow: false,
sort: null,
icon: null,
affix: false,

Loading…
Cancel
Save