From b9be79b05adc116aaf68308bea36b6b379a81331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Thu, 9 Jan 2025 20:15:42 +0800 Subject: [PATCH] feat: Menu enables vue-router mode (#7681) --- .../src/components/layout-content/index.vue | 2 +- .../src/layout/components/Sidebar/index.vue | 23 ++++--------------- frontend/src/layout/index.vue | 2 +- frontend/vite.config.ts | 2 +- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/frontend/src/components/layout-content/index.vue b/frontend/src/components/layout-content/index.vue index 56b4ea84c..6874aa250 100644 --- a/frontend/src/components/layout-content/index.vue +++ b/frontend/src/components/layout-content/index.vue @@ -36,7 +36,7 @@ - + {{ title }} diff --git a/frontend/src/layout/components/Sidebar/index.vue b/frontend/src/layout/components/Sidebar/index.vue index ec6233be8..89d13798d 100644 --- a/frontend/src/layout/components/Sidebar/index.vue +++ b/frontend/src/layout/components/Sidebar/index.vue @@ -13,7 +13,7 @@ - - + + @@ -55,13 +55,7 @@ import PrimaryMenu from '@/assets/images/menu-bg.svg?component'; const route = useRoute(); const menuStore = MenuStore(); const globalStore = GlobalStore(); -defineProps({ - menuRouter: { - type: Boolean, - default: true, - required: false, - }, -}); + const activeMenu = computed(() => { const { meta, path } = route; return isString(meta.activeMenu) ? meta.activeMenu : path; @@ -201,13 +195,6 @@ onMounted(() => { line-height: normal; } -.custom-menu .el-menu-item { - white-space: normal !important; - word-break: break-word; - overflow-wrap: break-word; - line-height: normal; -} - .sidebar-container { position: relative; display: flex; diff --git a/frontend/src/layout/index.vue b/frontend/src/layout/index.vue index f4ba5f031..8416cca2f 100644 --- a/frontend/src/layout/index.vue +++ b/frontend/src/layout/index.vue @@ -2,7 +2,7 @@
- +
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 11c0c1923..a4280520f 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -85,7 +85,7 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { ], esbuild: { pure: viteEnv.VITE_DROP_CONSOLE ? ['console.log'] : [], - drop: viteEnv.VITE_DROP_CONSOLE ? ['debugger'] : [], + drop: viteEnv.VITE_DROP_CONSOLE && process.env.NODE_ENV === 'production' ? ['debugger'] : [], }, build: { outDir: '../cmd/server/web',