Skip to content

Commit

Permalink
fix(projects): fix vertical-menu will not render when the layout is f…
Browse files Browse the repository at this point in the history
…rom mobile
  • Loading branch information
honghuangdc committed Jul 22, 2024
1 parent 4e55b0e commit 8402734
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/layouts/modules/global-menu/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue';
import type { Component } from 'vue';
import { useAppStore } from '@/store/modules/app';
import { useThemeStore } from '@/store/modules/theme';
import VerticalMenu from './modules/vertical-menu.vue';
import VerticalMixMenu from './modules/vertical-mix-menu.vue';
Expand All @@ -12,6 +13,7 @@ defineOptions({
name: 'GlobalMenu'
});
const appStore = useAppStore();
const themeStore = useThemeStore();
const activeMenu = computed(() => {
Expand All @@ -24,10 +26,12 @@ const activeMenu = computed(() => {
return menuMap[themeStore.layout.mode];
});
const reRenderVertical = computed(() => themeStore.layout.mode === 'vertical' && appStore.isMobile);
</script>

<template>
<component :is="activeMenu" />
<component :is="activeMenu" :key="reRenderVertical" />
</template>

<style scoped></style>

0 comments on commit 8402734

Please sign in to comment.