Skip to content

Commit 44db2bc

Browse files
committed
chore(app): improve items types
1 parent 5d72e6f commit 44db2bc

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

‎app/components/TeamsMenu.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import type { DropdownMenuItem } from '@nuxt/ui'
3+
24
defineProps<{
35
collapsed?: boolean
46
}>()
@@ -24,7 +26,7 @@ const teams = ref([{
2426
}])
2527
const selectedTeam = ref(teams.value[0])
2628
27-
const items = computed(() => {
29+
const items = computed<DropdownMenuItem[][]>(() => {
2830
return [teams.value.map(team => ({
2931
...team,
3032
onSelect() {

‎app/components/settings/MembersList.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import type { DropdownMenuItem } from '@nuxt/ui'
23
import type { Member } from '~/types'
34
45
defineProps<{
@@ -12,7 +13,7 @@ const items = [{
1213
label: 'Remove member',
1314
color: 'error' as const,
1415
onSelect: () => console.log('Remove member')
15-
}]
16+
}] satisfies DropdownMenuItem[]
1617
</script>
1718

1819
<template>

‎app/layouts/default.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import type { NavigationMenuItem } from '@nuxt/ui'
3+
24
const route = useRoute()
35
const toast = useToast()
46
@@ -67,7 +69,7 @@ const links = [[{
6769
icon: 'i-lucide-info',
6870
to: 'https://github.com/nuxt/ui-pro',
6971
target: '_blank'
70-
}]]
72+
}]] satisfies NavigationMenuItem[][]
7173
7274
const groups = computed(() => [{
7375
id: 'links',

‎app/pages/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script setup lang="ts">
22
import { sub } from 'date-fns'
3+
import type { DropdownMenuItem } from '@nuxt/ui'
34
import type { Period, Range } from '~/types'
45
56
const { isNotificationsSlideoverOpen } = useDashboard()
@@ -12,7 +13,7 @@ const items = [[{
1213
label: 'New customer',
1314
icon: 'i-lucide-user-plus',
1415
to: '/customers'
15-
}]]
16+
}]] satisfies DropdownMenuItem[][]
1617
1718
const range = shallowRef<Range>({
1819
start: sub(new Date(), { days: 14 }),

‎app/pages/settings.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<script setup lang="ts">
2+
import type { NavigationMenuItem } from '@nuxt/ui'
3+
24
const links = [[{
35
label: 'General',
46
icon: 'i-lucide-user',
@@ -26,7 +28,7 @@ const links = [[{
2628
icon: 'i-lucide-shopping-cart',
2729
to: 'https://ui.nuxt.com/pro/purchase',
2830
target: '_blank'
29-
}]]
31+
}]] satisfies NavigationMenuItem[][]
3032
</script>
3133

3234
<template>

0 commit comments

Comments
 (0)