refactor: format InputItem type=number as number

This commit is contained in:
axolotle 2024-08-13 01:58:07 +02:00
parent 8507e35ff2
commit a12e168b45

View file

@ -31,7 +31,14 @@ defineEmits<{
const touch = inject(ValidationTouchSymbol) const touch = inject(ValidationTouchSymbol)
const model = defineModel<string | number | null>() const model = defineModel<string | number | null>({
set(value) {
if (props.type === 'number' && typeof value === 'string') {
return parseInt(value)
}
return value
}
})
const autocomplete = computed(() => { const autocomplete = computed(() => {
const typeToAutocomplete = { const typeToAutocomplete = {