From 25b3eb9de609f7812b9ac45b9e7841e0a04c5df5 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 29 Aug 2025 19:11:49 +0900 Subject: [PATCH] fix --- packages/frontend/src/components/MkInput.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/components/MkInput.vue b/packages/frontend/src/components/MkInput.vue index 12860dd134..0c6f03d7d6 100644 --- a/packages/frontend/src/components/MkInput.vue +++ b/packages/frontend/src/components/MkInput.vue @@ -94,8 +94,8 @@ const emit = defineEmits<{ (ev: 'update:modelValue', value: ModelValueType): void; }>(); -const { modelValue, type, autofocus } = toRefs(props); -const v = ref(modelValue.value); +const { modelValue } = toRefs(props); +const v = ref | null>(modelValue.value); const id = genId(); const focused = ref(false); const changed = ref(false); @@ -128,8 +128,8 @@ const onKeydown = (ev: KeyboardEvent) => { const updated = () => { changed.value = false; - if (type.value === 'number') { - emit('update:modelValue', typeof v.value === 'number' ? v.value : parseFloat(v.value ?? '0')); + if (props.type === 'number') { + emit('update:modelValue', typeof v.value === 'number' ? v.value as ModelValueType : parseFloat(v.value ?? '0') as ModelValueType); } else { emit('update:modelValue', v.value ?? ''); } @@ -175,7 +175,7 @@ useInterval(() => { onMounted(() => { nextTick(() => { - if (autofocus.value) { + if (props.autofocus) { focus(); } });