From 041f9646b47ad9bead9ba45e9e618b4203caeafa Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Wed, 22 May 2024 16:40:49 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=B7=BB=E5=8A=A0header=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/search/Header.vue | 54 ++++++++++++++++++++++++++++++++++ pages/search/[id].vue | 44 +++------------------------ 2 files changed, 58 insertions(+), 40 deletions(-) diff --git a/components/i/search/Header.vue b/components/i/search/Header.vue index e69de29..7dc1ed4 100644 --- a/components/i/search/Header.vue +++ b/components/i/search/Header.vue @@ -0,0 +1,54 @@ + + + + + + {{ editTitle }} + + + / + 收藏 + + + 收藏 + 分享 + + + + + + \ No newline at end of file diff --git a/pages/search/[id].vue b/pages/search/[id].vue index f45a47d..281af04 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -1,28 +1,6 @@ - - - - - {{ state.query }} - - - / - 收藏 - - - 收藏 - 分享 - - - - + {{ state.query }} @@ -76,7 +54,9 @@ const state = reactive({ useHead({ title: `${state.query} - GitBot` }) - +function handleUpdateQuery(query) { + state.query = query; +} // 是否停止自动滚动到底部 const isAutoToBottom = ref(true) const handleScroll = (event, params) => { @@ -96,22 +76,6 @@ const scrollToView = () => { const height = $target.clientHeight y.value = height } -const isEditTitle = ref(false) -const titleRef = ref(null) -const handleFocusTitle = () => { - isEditTitle.value = true -} -const handleBlurTitle = () => { - isEditTitle.value = false -} -function handleShare () { - useCopyToClipboard().copy(window.location.href) - toast.add({ - icon: 'i-heroicons-information-circle-20-solid', - timeout: 2000, - title: '链接已复制到剪贴板' - }) -} const handleReGenerate = (index) => { editIndex.value = index const question = data.value[editIndex.value].question -- GitLab