Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 8014127

Browse files
committed
Update modelValue prop to accept string or number
1 parent 9ad0663 commit 8014127

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/UI/Select.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type Props = {
8484
label?: string
8585
8686
// Select props
87-
modelValue?: string
87+
modelValue?: string | number
8888
disabled?: boolean
8989
required?: boolean
9090
id?: string
@@ -93,6 +93,12 @@ type Props = {
9393
const emit = defineEmits(['update:modelValue'])
9494
const emitUpdate = (event: Event) => {
9595
const selectElement = event.target as HTMLSelectElement
96+
97+
if (typeof props.modelValue == 'number') {
98+
emit('update:modelValue', Number(selectElement.value))
99+
return
100+
}
101+
96102
emit('update:modelValue', selectElement.value)
97103
}
98104

0 commit comments

Comments
 (0)