Skip to content

Commit 8402734

Browse files
committed
fix(projects): fix vertical-menu will not render when the layout is from mobile
1 parent 4e55b0e commit 8402734

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/layouts/modules/global-menu/index.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { computed } from 'vue';
33
import type { Component } from 'vue';
4+
import { useAppStore } from '@/store/modules/app';
45
import { useThemeStore } from '@/store/modules/theme';
56
import VerticalMenu from './modules/vertical-menu.vue';
67
import VerticalMixMenu from './modules/vertical-mix-menu.vue';
@@ -12,6 +13,7 @@ defineOptions({
1213
name: 'GlobalMenu'
1314
});
1415
16+
const appStore = useAppStore();
1517
const themeStore = useThemeStore();
1618
1719
const activeMenu = computed(() => {
@@ -24,10 +26,12 @@ const activeMenu = computed(() => {
2426
2527
return menuMap[themeStore.layout.mode];
2628
});
29+
30+
const reRenderVertical = computed(() => themeStore.layout.mode === 'vertical' && appStore.isMobile);
2731
</script>
2832

2933
<template>
30-
<component :is="activeMenu" />
34+
<component :is="activeMenu" :key="reRenderVertical" />
3135
</template>
3236

3337
<style scoped></style>

0 commit comments

Comments
 (0)