Skip to content

Commit cb2f726

Browse files
committed
feat(app): add template menu in header
1 parent f03a64f commit cb2f726

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<RouterLink to="/">
77
<AppLogo class="w-auto h-6 shrink-0" />
88
</RouterLink>
9+
10+
<TemplateMenu />
911
</template>
1012

1113
<template #right>

src/components/TemplateMenu.vue

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<template>
2+
<UDropdownMenu
3+
v-slot="{ open }"
4+
:modal="false"
5+
:items="[{
6+
label: 'Starter',
7+
to: 'https://starter-vue-template.nuxt.dev/',
8+
color: 'primary',
9+
checked: true,
10+
type: 'checkbox'
11+
}, {
12+
label: 'Dashboard',
13+
to: 'https://dashboard-vue-template.nuxt.dev/'
14+
}]"
15+
:content="{ align: 'start' }"
16+
:ui="{ content: 'min-w-fit' }"
17+
size="xs"
18+
>
19+
<UButton
20+
label="Starter"
21+
variant="subtle"
22+
trailing-icon="i-lucide-chevron-down"
23+
size="xs"
24+
class="-mb-[6px] font-semibold rounded-full truncate"
25+
:class="[open && 'bg-primary/15']"
26+
:ui="{
27+
trailingIcon: ['transition-transform duration-200', open ? 'rotate-180' : undefined].filter(Boolean).join(' ')
28+
}"
29+
/>
30+
</UDropdownMenu>
31+
</template>

0 commit comments

Comments
 (0)