From 6694e7e92965df55537d74fc27fc0d9610fdeb1e Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 12 Oct 2023 08:13:05 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=90=9C=E7=B4=A2=E6=A1=86=E8=81=9A?= =?UTF-8?q?=E7=84=A6=E3=80=81=E5=8F=91=E7=8E=B0=E9=A1=B5=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/components/SearchBar.vue | 31 ++++++++++++++++++---------- src/pages/resource.vue | 19 ++++++----------- src/router/index.ts | 2 ++ 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/layouts/components/SearchBar.vue b/src/layouts/components/SearchBar.vue index ecbda2a3..b1f85c59 100644 --- a/src/layouts/components/SearchBar.vue +++ b/src/layouts/components/SearchBar.vue @@ -8,6 +8,9 @@ const searchWord = ref('') // 搜索弹窗 const searchDialog = ref(false) +// ref +const searchWordInput = ref(null) + // Search function search() { if (!searchWord.value) @@ -21,6 +24,14 @@ function search() { }, }) } + +// 打开搜索弹窗 +function openSearchDialog() { + searchDialog.value = true + nextTick(() => { + searchWordInput.value?.focus() + }) +}