fix: InputItem: return empty string for none value in type number

This commit is contained in:
axolotle 2024-08-21 18:31:25 +02:00
parent 008c2c53ab
commit 9649627bb8

View file

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