From efe679a7dd26f8ead992535cd4e4f9dc7d23d5c1 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Sun, 6 Jul 2025 22:16:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=80=E7=89=88=E8=99=9A=E6=8B=9F=E9=94=AE=E7=9B=98=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E7=82=B9=E5=87=BB=E5=92=8C=E9=95=BF=E6=8C=89=E6=B6=88?= =?UTF-8?q?=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/FTInput/index.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/common/FTInput/index.vue b/src/components/common/FTInput/index.vue index e8f2802..3ef9c72 100644 --- a/src/components/common/FTInput/index.vue +++ b/src/components/common/FTInput/index.vue @@ -83,6 +83,10 @@ emits('focus') // }, 100) const blurInput = () => { + if (ignoreBlur.value) { + ignoreBlur.value = false + return + } setTimeout(() => { if (!entering.value) { handleClose() @@ -167,13 +171,20 @@ const onKeyPress = (button: any) => { return handleBackspace() } +const ignoreBlur = ref(false) + const handleBackspace = () => { + ignoreBlur.value = true // const position = keyboard.value.getCaretPosition() // console.log(position) const value = model.value?.toString() || '' model.value = value.slice(0, -1) console.log(model.value) + // 设置短时间延迟恢复 blur 监听 + setTimeout(() => { + ignoreBlur.value = false + }, 150) } const handleLock = () => { @@ -244,6 +255,9 @@ const handlePopClose = (e: any) => { inputRef.value.ref.selectionStart = inputRef.value.ref.selectionEnd = index inputRef.value.focus() } + else { + console.log('失去了') + } } const close = () => {