Browse Source

fix(nc-gui): numeric cell type issues

pull/5307/head
Wing-Kam Wong 2 years ago
parent
commit
e284b96d2b
  1. 15
      packages/nc-gui/components/cell/Decimal.vue
  2. 13
      packages/nc-gui/components/cell/Float.vue
  3. 13
      packages/nc-gui/components/cell/Integer.vue

15
packages/nc-gui/components/cell/Decimal.vue

@ -3,7 +3,7 @@ import type { VNodeRef } from '@vue/runtime-core'
import { EditModeInj, inject, useVModel } from '#imports'
interface Props {
modelValue?: number | null | string
modelValue?: number | null
}
interface Emits {
@ -18,18 +18,7 @@ const { showNull } = useGlobal()
const editEnabled = inject(EditModeInj)
const _vModel = useVModel(props, 'modelValue', emits)
const vModel = computed({
get: () => _vModel.value,
set: (value: string) => {
if (value === '') {
_vModel.value = null
} else {
_vModel.value = value
}
},
})
const vModel = useVModel(props, 'modelValue', emits)
const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
</script>

13
packages/nc-gui/components/cell/Float.vue

@ -18,18 +18,7 @@ const { showNull } = useGlobal()
const editEnabled = inject(EditModeInj)
const _vModel = useVModel(props, 'modelValue', emits)
const vModel = computed({
get: () => _vModel.value,
set: (value: string) => {
if (value === '') {
_vModel.value = null
} else {
_vModel.value = value
}
},
})
const vModel = useVModel(props, 'modelValue', emits)
const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
</script>

13
packages/nc-gui/components/cell/Integer.vue

@ -18,18 +18,7 @@ const { showNull } = useGlobal()
const editEnabled = inject(EditModeInj)
const _vModel = useVModel(props, 'modelValue', emits)
const vModel = computed({
get: () => _vModel.value,
set: (value: string) => {
if (value === '') {
_vModel.value = null
} else {
_vModel.value = value
}
},
})
const vModel = useVModel(props, 'modelValue', emits)
const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus()

Loading…
Cancel
Save