From 65e172449a48048ebf7970cc4cdf28d50d84b73c Mon Sep 17 00:00:00 2001 From: DebugIsFalse <511418503@qq.com> Date: Fri, 17 May 2024 17:06:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=90=9C=E7=B4=A2=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/i/Create.vue | 3 ++- components/md/renderer.vue | 7 ++++++- pages/search/[id].vue | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/i/Create.vue b/components/i/Create.vue index 4355892..e4693fd 100644 --- a/components/i/Create.vue +++ b/components/i/Create.vue @@ -25,6 +25,7 @@ trailing-icon="i-heroicons-chevron-right-20-solid" @click="handleSearch" :loading="loading" + :disabled="query === ''" >搜索 @@ -41,7 +42,7 @@ const repos = ref([ ]) const loading = ref(false) const handleSearch = async () => { - if (loading.value) return + if (loading.value || query.value === '') return loading.value = true const result = await fetchRequest('/v1/chat/completion/create', { method: 'post', diff --git a/components/md/renderer.vue b/components/md/renderer.vue index c5f521d..3efeb40 100644 --- a/components/md/renderer.vue +++ b/components/md/renderer.vue @@ -34,4 +34,9 @@ const handleRenderMd = () => { watch( () => props.content, () => { handleRenderMd() }, { immediate: true }) - \ No newline at end of file + + \ No newline at end of file diff --git a/pages/search/[id].vue b/pages/search/[id].vue index 4dcfc17..b4c7301 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -182,6 +182,7 @@ const handleScroll = () => { const scrollToView = () => { if (!isAutoToBottom.value) return const $target = document.querySelector('#scrollElement') + if (!$target) return; const height = $target.clientHeight y.value = height } -- GitLab