diff --git a/adminforth/spa/src/components/ColumnValueInput.vue b/adminforth/spa/src/components/ColumnValueInput.vue index 8cf51490..c011860c 100644 --- a/adminforth/spa/src/components/ColumnValueInput.vue +++ b/adminforth/spa/src/components/ColumnValueInput.vue @@ -99,8 +99,8 @@ :fullWidth="true" :prefix="column.inputPrefix" :suffix="column.inputSuffix" - :modelValue="String(value)" - @update:modelValue="$emit('update:modelValue', String($event))" + :modelValue="value == null ? null : value.toString().replace(/(\.[0-9]*[1-9])0+$|\.0+$/, '$1')" + @update:modelValue="(val: string | number | null | undefined) => $emit('update:modelValue', val == null || (typeof val === 'number' && Number.isNaN(val)) ? '' : String(val))" /> {}) as any); const input = ref(null); - const getBooleanOptions = (column: any) => { const options: Array<{ label: string; value: boolean | null }> = [ { label: t('Yes'), value: true },