Skip to content

Commit 9b19a33

Browse files
committed
fix: enhance modelValue handling in ColumnValueInput to support null and improve formatting
1 parent 747d0da commit 9b19a33

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
:fullWidth="true"
100100
:prefix="column.inputPrefix"
101101
:suffix="column.inputSuffix"
102-
:modelValue="value?.toString().replace(/(\.[0-9]*[1-9])0+$|\.0+$/, '$1')"
103-
@update:modelValue="(val: string | number) => $emit('update:modelValue', val !== null ? String(val) : '')"
102+
:modelValue="value == null ? null : value.toString().replace(/(\.[0-9]*[1-9])0+$|\.0+$/, '$1')"
103+
@update:modelValue="(val: string | number | null | undefined) => $emit('update:modelValue', val == null || (typeof val === 'number' && Number.isNaN(val)) ? '' : String(val))"
104104
/>
105105
<Input
106106
v-else-if="(type || column.type) === 'float'"

0 commit comments

Comments
 (0)