From 41bcd226be776c159796b09a71f20809bce12d3e Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Tue, 29 Mar 2022 02:06:32 +0800 Subject: [PATCH] fix: add menu type judgment --- src/api/account/model.d.ts | 3 +- src/layout/menu/menu-item.vue | 54 +++++++++++++-------------- src/layout/menu/menu.vue | 10 +++-- src/router/generator-router.tsx | 1 + src/views/dashboard/welcome/index.vue | 28 +++++++++++++- types/vue-router.d.ts | 4 +- 6 files changed, 64 insertions(+), 36 deletions(-) diff --git a/src/api/account/model.d.ts b/src/api/account/model.d.ts index cf790a24f..72512de5e 100644 --- a/src/api/account/model.d.ts +++ b/src/api/account/model.d.ts @@ -7,7 +7,8 @@ declare namespace API { name: string; router: string; perms: string; - type: number; + /** 当前菜单类型 0: 目录 | 1: 菜单 | 2: 权限 */ + type: 0 | 1 | 2; icon: string; orderNum: number; viewPath: string; diff --git a/src/layout/menu/menu-item.vue b/src/layout/menu/menu-item.vue index 5c9b70682..1b169b9bd 100644 --- a/src/layout/menu/menu-item.vue +++ b/src/layout/menu/menu-item.vue @@ -1,29 +1,27 @@