From 7be349c937f09ce69305098aea7b4b3cf1a957ad Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:59:51 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=BF=AB=E9=80=9F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=90=8D=E7=A7=B0=E5=92=8C=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81=E5=9B=9E=E8=BD=A6=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/read-write/index.vue | 12 +++++++----- ui/src/views/document/index.vue | 6 +++--- ui/src/views/problem/index.vue | 8 ++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ui/src/components/read-write/index.vue b/ui/src/components/read-write/index.vue index 5cc99a404..013bf7fc0 100644 --- a/ui/src/components/read-write/index.vue +++ b/ui/src/components/read-write/index.vue @@ -21,6 +21,8 @@ autofocus :maxlength="maxlength || '-'" :show-word-limit="maxlength ? true : false" + @blur="isEdit = false" + @keyup.enter="submit" > @@ -64,6 +66,10 @@ const loading = ref(false) watch(isEdit, (bool) => { if (!bool) { writeValue.value = '' + } else { + nextTick(() => { + inputRef.value?.focus() + }) } }) @@ -80,10 +86,6 @@ function editNameHandle() { isEdit.value = true } -onMounted(() => { - nextTick(() => { - inputRef.value?.focus() - }) -}) +onMounted(() => {}) diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index 3c9b5e216..8705ed818 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -54,7 +54,7 @@