fix(playground): typecheck

This commit is contained in:
Romain Hamel
2024-09-11 18:53:19 +02:00
parent 594bc9bb2e
commit cf92c5f3f0
2 changed files with 4 additions and 4 deletions

View File

@@ -180,7 +180,7 @@ const groups = computed(() => {
}
acc[item.group] ||= []
acc[item.group].push({ ...item, matches })
acc[item.group]?.push({ ...item, matches })
return acc
}, {} as Record<string, (T & { matches?: FuseResult<T>['matches'] })[]>)

View File

@@ -26,11 +26,11 @@ export function useToast() {
return body
}
function update(id: string | number, toast: Partial<Toast>) {
function update(id: string | number, toast: Omit<Partial<Toast>, "id">) {
const index = toasts.value.findIndex((t: Toast) => t.id === id)
if (index !== -1) {
toasts.value[index] = {
...toasts.value[index],
...toasts.value[index] as Toast,
...toast
}
}
@@ -40,7 +40,7 @@ export function useToast() {
const index = toasts.value.findIndex((t: Toast) => t.id === id)
if (index !== -1) {
toasts.value[index] = {
...toasts.value[index],
...toasts.value[index] as Toast,
open: false
}
}