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