diff --git a/packages/nc-gui-v2/components/cell/Integer.vue b/packages/nc-gui-v2/components/cell/Integer.vue index 5cea217783..3355265046 100644 --- a/packages/nc-gui-v2/components/cell/Integer.vue +++ b/packages/nc-gui-v2/components/cell/Integer.vue @@ -3,34 +3,36 @@ interface Props { modelValue: number } -const { modelValue: value } = defineProps() +interface Emits { + (event: 'update:modelValue', model: number): void +} + +const props = defineProps() -const emit = defineEmits(['update:modelValue']) +const emits = defineEmits() const editEnabled = inject('editEnabled') const root = ref() -const localState = computed({ - get: () => value, - set: (val) => emit('update:modelValue', val), -}) +const vModel = useVModel(props, 'modelValue', emits) onMounted(() => { root.value?.focus() }) + +function onKeyDown(evt: KeyboardEvent) { + return evt.key === '.' && evt.preventDefault() +}