fix: frontend build error

This commit is contained in:
shaw
2025-12-18 14:26:55 +08:00
parent 642842c29e
commit 3d05e50335
33 changed files with 545 additions and 269 deletions

View File

@@ -53,7 +53,7 @@
<div class="select-options">
<div
v-for="option in filteredOptions"
:key="getOptionValue(option)"
:key="getOptionValue(option) ?? undefined"
@click="selectOption(option)"
:class="[
'select-option',
@@ -136,9 +136,9 @@ const searchQuery = ref('')
const containerRef = ref<HTMLElement | null>(null)
const searchInputRef = ref<HTMLInputElement | null>(null)
const getOptionValue = (option: SelectOption | Record<string, unknown>): string | number | null => {
const getOptionValue = (option: SelectOption | Record<string, unknown>): string | number | null | undefined => {
if (typeof option === 'object' && option !== null) {
return option[props.valueKey] as string | number | null
return option[props.valueKey] as string | number | null | undefined
}
return option as string | number | null
}
@@ -187,7 +187,7 @@ const toggle = () => {
}
const selectOption = (option: SelectOption | Record<string, unknown>) => {
const value = getOptionValue(option)
const value = getOptionValue(option) ?? null
emit('update:modelValue', value)
emit('change', value, option as SelectOption)
isOpen.value = false