解决菜单配置 isShow 异常处理

This commit is contained in:
icssoa 2021-03-18 18:24:18 +08:00
parent 9d1034460e
commit efa7ea764a
3 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "cool-admin-vue", "name": "cool-admin-vue",
"version": "3.1.1", "version": "3.1.2",
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build": "vue-cli-service build",

View File

@ -6,7 +6,7 @@
background-color="transparent" background-color="transparent"
@select="onSelect" @select="onSelect"
> >
<el-menu-item v-for="(item, index) in menuGroup" :index="`${index}`" :key="index"> <el-menu-item v-for="(item, index) in list" :index="`${index}`" :key="index">
<icon-svg v-if="item.icon" :name="item.icon"></icon-svg> <icon-svg v-if="item.icon" :name="item.icon"></icon-svg>
<span>{{ item.name }}</span> <span>{{ item.name }}</span>
</el-menu-item> </el-menu-item>
@ -28,7 +28,11 @@ export default {
}, },
computed: { computed: {
...mapGetters(["menuGroup"]) ...mapGetters(["menuGroup"]),
list() {
return this.menuGroup.filter(e => e.isShow);
}
}, },
mounted() { mounted() {

View File

@ -42,7 +42,7 @@ export default {
} }
const routes = res.menus const routes = res.menus
.filter(e => e.type != 2 && e.isShow) .filter(e => e.type != 2)
.map(e => { .map(e => {
return { return {
moduleName: e.moduleName, moduleName: e.moduleName,