修改了menu的查询次数 增强了菜单查询时的性能

This commit is contained in:
pixel
2020-05-06 11:19:35 +08:00
parent b44c5f76e1
commit 7e9d32651b
8 changed files with 58 additions and 26 deletions
@@ -1,6 +1,6 @@
<template>
<component :is="menuComponent" :routerInfo="routerInfo" v-if="!routerInfo.hidden">
<template v-if="routerInfo.children.length">
<template v-if="routerInfo.children&&routerInfo.children.length">
<AsideComponent :key="item.name" :routerInfo="item" v-for="item in routerInfo.children" />
</template>
</component>
@@ -14,7 +14,7 @@ export default {
name: 'AsideComponent',
computed: {
menuComponent() {
if (this.routerInfo.children.filter(item=>!item.hidden).length) {
if (this.routerInfo.children&&this.routerInfo.children.filter(item=>!item.hidden).length) {
return 'AsyncSubmenu'
} else {
return 'MenuItem'