forked from nuxt/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
101 lines (96 loc) · 1.84 KB
/
index.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<template>
<div class="text-center">
<h1 class="font-semibold mb-1">
Playground
</h1>
<div class="flex items-center justify-center gap-1">
<DDDropdownMenu
v-model:open="dropdownMenuTrigger"
:items="items"
size="lg"
:content="{ align: 'start' }"
>
<DDButton label="Open" />
</DDDropdownMenu>
</div>
</div>
</template>
<script setup lang="ts">
const items = ref([
[
{
label: 'Settings',
icon: 'i-lucide-settings-2',
kbds: ['ctrl', 's'],
to: '/settings'
},
{
label: 'Theme',
icon: 'i-lucide-palette',
children: [
{
label: 'Light',
icon: 'i-lucide-sun',
kbds: ['alt', 'meta', 'l']
},
{
label: 'Dark',
icon: 'i-lucide-moon',
kbds: ['alt', 'meta', 'd']
},
{
label: 'System',
icon: 'i-lucide-monitor',
kbds: ['alt', 'meta', 's']
}
]
}
],
[
{
label: 'Inquiry',
icon: 'i-lucide-message-circle-more',
kbds: ['ctrl', 'i'],
to: '/settings/inquiry'
},
{
label: 'Plan',
icon: 'i-lucide-crown',
kbds: ['ctrl', 'p'],
to: '/settings/plan'
}
],
[
{
label: 'Signin',
icon: 'i-lucide-log-in',
kbds: ['ctrl', 'l'],
to: '/login'
}
]
])
const dropdownMenuTrigger = ref(false)
defineShortcuts(
extractShortcuts(items.value)
)
defineShortcuts({
ctrl_d: () => {
dropdownMenuTrigger.value = !dropdownMenuTrigger.value
},
ctrl_s: () => {
navigateTo('/settings')
},
ctrl_t: () => {
navigateTo('/settings/theme')
},
ctrl_l: () => {
navigateTo('/login')
},
ctrl_i: () => {
navigateTo('/settings/inquiry')
},
ctrl_p: () => {
navigateTo('/settings/plan')
}
})
</script>