|
1 | 1 | <template> |
2 | 2 | <div class="comfyui-body grid h-full w-full overflow-hidden"> |
3 | 3 | <div id="comfyui-body-top" class="comfyui-body-top"> |
4 | | - <TopMenubar v-if="useNewMenu === 'Top'" /> |
| 4 | + <TopMenubar v-if="showTopMenu" /> |
5 | 5 | </div> |
6 | 6 | <div id="comfyui-body-bottom" class="comfyui-body-bottom"> |
7 | | - <TopMenubar v-if="useNewMenu === 'Bottom'" /> |
| 7 | + <TopMenubar v-if="showBottomMenu" /> |
8 | 8 | </div> |
9 | 9 | <div id="comfyui-body-left" class="comfyui-body-left" /> |
10 | 10 | <div id="comfyui-body-right" class="comfyui-body-right" /> |
|
20 | 20 | </template> |
21 | 21 |
|
22 | 22 | <script setup lang="ts"> |
23 | | -import { useEventListener } from '@vueuse/core' |
| 23 | +import { useBreakpoints, useEventListener } from '@vueuse/core' |
24 | 24 | import type { ToastMessageOptions } from 'primevue/toast' |
25 | 25 | import { useToast } from 'primevue/usetoast' |
26 | 26 | import { computed, onBeforeUnmount, onMounted, watch, watchEffect } from 'vue' |
@@ -70,6 +70,12 @@ const settingStore = useSettingStore() |
70 | 70 | const executionStore = useExecutionStore() |
71 | 71 | const colorPaletteStore = useColorPaletteStore() |
72 | 72 | const queueStore = useQueueStore() |
| 73 | +const breakpoints = useBreakpoints({ md: 961 }) |
| 74 | +const isMobile = breakpoints.smaller('md') |
| 75 | +const showTopMenu = computed(() => isMobile.value || useNewMenu.value === 'Top') |
| 76 | +const showBottomMenu = computed( |
| 77 | + () => !isMobile.value && useNewMenu.value === 'Bottom' |
| 78 | +) |
73 | 79 |
|
74 | 80 | watch( |
75 | 81 | () => colorPaletteStore.completedActivePalette, |
|
0 commit comments