fix: type error

This commit is contained in:
Rizumu Ayaka
2026-02-03 20:58:54 +08:00
parent e6e341262c
commit 90659a0081
2 changed files with 4 additions and 5 deletions

View File

@@ -3,15 +3,14 @@ import { describe, expect, it } from 'vitest'
import { nextTick } from 'vue'
import FormDropdownMenu from './FormDropdownMenu.vue'
import type { DropdownItem, LayoutMode } from './types'
import type { FormDropdownItem, LayoutMode } from './types'
function createItem(id: string, name: string): DropdownItem {
function createItem(id: string, name: string): FormDropdownItem {
return {
id,
mediaSrc: '',
name,
label: name,
metadata: ''
preview_url: ''
}
}

View File

@@ -86,7 +86,7 @@ type VirtualDropdownItem = FormDropdownItem & { key: string }
const virtualItems = computed<VirtualDropdownItem[]>(() =>
items.map((item) => ({
...item,
key: item.id
key: String(item.id)
}))
)
</script>