|
|
|
@ -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> |
|
|
|
|