diff --git a/app/components/pub/my-ui/combobox/combobox.vue b/app/components/pub/my-ui/combobox/combobox.vue index ab625b01..5f0292e7 100644 --- a/app/components/pub/my-ui/combobox/combobox.vue +++ b/app/components/pub/my-ui/combobox/combobox.vue @@ -4,7 +4,7 @@ import { type Item } from './index' const props = defineProps<{ id?: string - modelValue?: string + modelValue?: string | number items: Item[] placeholder?: string searchPlaceholder?: string @@ -16,8 +16,8 @@ const props = defineProps<{ const model = defineModel() const emit = defineEmits<{ - 'update:modelValue': [value: string] - 'update:searchText': [value: string] + 'update:modelValue': [value: string | number] + 'update:searchText': [value: string | number] }>() const open = ref(false) diff --git a/app/components/pub/my-ui/combobox/index.ts b/app/components/pub/my-ui/combobox/index.ts index e4864f7f..f3038de7 100644 --- a/app/components/pub/my-ui/combobox/index.ts +++ b/app/components/pub/my-ui/combobox/index.ts @@ -1,5 +1,5 @@ export interface Item { - value: string + value: string | number label: string code?: string priority?: number @@ -7,12 +7,12 @@ export interface Item { export function recStrToItem(input: Record): Item[] { const items: Item[] = [] - let idx = 0; + let idx = 0 for (const key in input) { if (input.hasOwnProperty(key)) { items.push({ - value: key || ('unknown-' + idx), - label: input[key] || ('unknown-' + idx), + value: key || 'unknown-' + idx, + label: input[key] || 'unknown-' + idx, }) } idx++ diff --git a/app/components/pub/my-ui/content-switcher/content-switcher.vue b/app/components/pub/my-ui/content-switcher/content-switcher.vue index 267d94c1..3b79f193 100644 --- a/app/components/pub/my-ui/content-switcher/content-switcher.vue +++ b/app/components/pub/my-ui/content-switcher/content-switcher.vue @@ -1,33 +1,40 @@