|
1 | 1 | <template>
|
2 |
| - <div :class="[{'px-container' : isContainer }]"> |
3 |
| - <Menubar :model="mappedData" class="w-full border-none hidden lg:flex gap-5" :pt="{ |
4 |
| - root: { |
5 |
| - class: 'surface-ground' |
6 |
| - }, |
7 |
| - submenu: { |
8 |
| - class: 'rounded-md w-max max-w-xs' |
9 |
| - } |
10 |
| - }"> |
| 2 | + <!-- Desk --> |
| 3 | + <div class="!min-h-[56px]" :class="[{'px-container' : isContainer }]"> |
| 4 | + <Menubar |
| 5 | + class="w-full border-none hidden lg:flex gap-5" |
| 6 | + :model="mappedData" |
| 7 | + :pt="{ |
| 8 | + root: { |
| 9 | + class: 'surface-ground' |
| 10 | + }, |
| 11 | + submenu: { |
| 12 | + class: 'rounded-md w-max max-w-xs' |
| 13 | + } |
| 14 | + }" |
| 15 | + > |
11 | 16 | <template #start>
|
12 |
| - <p class="text-lg font-medium leading-relaxed">{{ menuTitle }}</p> |
| 17 | + <p class="text-lg font-medium leading-relaxed !min-h-[56px] flex items-center"> |
| 18 | + {{ menuTitle }} |
| 19 | + </p> |
13 | 20 | </template>
|
| 21 | + |
14 | 22 | <template #item="{ item, hasSubmenu, root }">
|
15 | 23 | <template v-if="item.url">
|
16 |
| - <a class="flex align-items-center p-3 leading-relaxed cursor-pointer" :href="item.url"> |
17 |
| - <span class="text-sm">{{ item.label }}</span> |
| 24 | + <a class="flex align-items-center p-3 leading-relaxed cursor-pointer !min-h-[44px]" :href="item.url"> |
| 25 | + <span class="text-sm"> |
| 26 | + {{ item.label }} |
| 27 | + </span> |
18 | 28 | </a>
|
19 | 29 | </template>
|
20 | 30 | <template v-else>
|
21 |
| - <a class="flex align-items-center p-3 leading-relaxed cursor-pointer"> |
22 |
| - <span class="text-sm">{{ item.label }}</span> |
23 |
| - <i v-if="hasSubmenu" |
24 |
| - :class="['pi pi-angle-down', { 'pi-angle-down ml-2': root, 'pi-angle-right ml-auto': !root }]"></i> |
| 31 | + <a class="flex align-items-center p-3 leading-relaxed cursor-pointer !min-h-[44px]"> |
| 32 | + <span class="text-sm"> |
| 33 | + {{ item.label }} |
| 34 | + </span> |
| 35 | + <i |
| 36 | + v-if="hasSubmenu" |
| 37 | + :class="['pi pi-angle-down', { 'pi-angle-down ml-2': root, 'pi-angle-right ml-auto': !root }]" |
| 38 | + > |
| 39 | + </i> |
25 | 40 | </a>
|
26 | 41 | </template>
|
27 | 42 | </template>
|
28 | 43 | </Menubar>
|
29 | 44 | </div>
|
30 |
| - <PanelMenu :model="mobile" class="block lg:hidden" :pt="{ |
31 |
| - root: { |
32 |
| - class: 'w-full', |
33 |
| - }, |
34 |
| - headerContent: { |
35 |
| - class: 'w-full border-none py-1 flex items-center min-h-8 text-sm', |
36 |
| - }, |
37 |
| - menuContent: { |
38 |
| - class: 'border-none text-sm', |
39 |
| - } |
40 |
| - }"> |
| 45 | + |
| 46 | + <!-- Mobile --> |
| 47 | + <PanelMenu |
| 48 | + class="block lg:hidden" |
| 49 | + :model="mobile" |
| 50 | + :pt="{ |
| 51 | + root: { |
| 52 | + class: 'w-full', |
| 53 | + }, |
| 54 | + headerContent: { |
| 55 | + class: 'w-full border-none py-1 flex items-center min-h-8 text-sm', |
| 56 | + }, |
| 57 | + menuContent: { |
| 58 | + class: 'border-none text-sm', |
| 59 | + } |
| 60 | + }" |
| 61 | + > |
41 | 62 | <template #item="{ item }">
|
42 | 63 | <template v-if="item.url">
|
43 |
| - <a class="flex align-items-center cursor-pointer text-color px-3 py-2 w-full" |
44 |
| - :href="item.url" target="_self"> |
45 |
| - <span class="ml-2">{{ item.label }}</span> |
| 64 | + <a |
| 65 | + class="flex align-items-center cursor-pointer text-color px-3 py-2 w-full" |
| 66 | + :href="item.url" target="_self" |
| 67 | + > |
| 68 | + <span class="ml-2"> |
| 69 | + {{ item.label }} |
| 70 | + </span> |
46 | 71 | </a>
|
47 | 72 | </template>
|
48 | 73 | <template v-else>
|
49 | 74 | <a class="flex align-items-center cursor-pointer text-color px-3 py-2 w-full" target="_self">
|
50 |
| - <span class="ml-2">{{ item.label }}</span> |
51 |
| - <span v-if="item.items" class="pi pi-angle-down text-primary ml-auto" /> |
| 75 | + <span class="ml-2"> |
| 76 | + {{ item.label }} |
| 77 | + </span> |
| 78 | + <span v-if="item.items" class="pi pi-angle-down text-primary ml-auto"></span> |
52 | 79 | </a>
|
53 | 80 | </template>
|
54 | 81 | </template>
|
55 | 82 | </PanelMenu>
|
56 | 83 | </template>
|
57 | 84 |
|
58 | 85 | <script setup>
|
59 |
| -import Menubar from 'primevue/menubar'; |
60 |
| -import PanelMenu from 'primevue/panelmenu'; |
61 | 86 | import { onBeforeMount, ref } from 'vue'
|
| 87 | +import Menubar from 'primevue/menubar' |
| 88 | +import PanelMenu from 'primevue/panelmenu' |
62 | 89 |
|
63 | 90 | const props = defineProps({
|
64 | 91 | menuTitle: {
|
|
0 commit comments