diff --git a/components/i/Create.vue b/components/i/Create.vue index 4355892a9d3eed6ff50e4975dd18b59f5a9cd798..e4693fdb0a9d30c4bfc2691be862c11c82f76391 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 c5f521dc471ec09f83e5712cf4c7017aef39c6d8..3efeb40c6394e3d95af249975ce8bf689753d60f 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 ae0081132cd6db48960b6e65b191dcdf58f3f2db..5946a761c99d6861b0f014f3aec96af7ada5a510 100644 --- a/pages/search/[id].vue +++ b/pages/search/[id].vue @@ -187,6 +187,7 @@ const handleScroll = () => { const scrollToView = () => { if (!isAutoToBottom.value) return const $target = document.querySelector('#scrollElement') + if (!$target) return; const height = $target.clientHeight y.value = height }