From 423ec0c32efa1df87ebc51b8ded166abe34cd9e7 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Thu, 10 Jul 2025 18:18:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=A0=E6=84=9F=E5=99=A8=E5=88=AB?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/FTInput/index.vue | 8 ++++-- src/components/home/Environment.vue | 45 ++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/components/common/FTInput/index.vue b/src/components/common/FTInput/index.vue index efada2a..fceb080 100644 --- a/src/components/common/FTInput/index.vue +++ b/src/components/common/FTInput/index.vue @@ -252,7 +252,7 @@ const handleClose = () => { // 处理精度 // model.value = model.value?.replace(new RegExp(`(\\d+)\\.(\\d{${props.precision}}).*$`), '$1.$2').replace(/\.$/, '') } - popoverRef.value.hide() + popoverRef.value?.hide() setTimeout(() => { ignoreBlur.value = false }, 150) @@ -300,7 +300,11 @@ onUnmounted(() => { document.removeEventListener('click', handlePopClose) }) -defineExpose({ inputRef, visible, open, close }) +const focus = () => { + inputRef.value.focus() +} + +defineExpose({ inputRef, visible, open, close, focus })