提交 4613b7de 编写于 作者: View Design's avatar View Design

Merge branch 'main' of gitcode.com:git_bot/ai-fe

...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
trailing-icon="i-heroicons-chevron-right-20-solid" trailing-icon="i-heroicons-chevron-right-20-solid"
@click="handleSearch" @click="handleSearch"
:loading="loading" :loading="loading"
:disabled="query === ''"
>搜索</UButton> >搜索</UButton>
</div> </div>
</UCard> </UCard>
...@@ -41,7 +42,7 @@ const repos = ref([ ...@@ -41,7 +42,7 @@ const repos = ref([
]) ])
const loading = ref(false) const loading = ref(false)
const handleSearch = async () => { const handleSearch = async () => {
if (loading.value) return if (loading.value || query.value === '') return
loading.value = true loading.value = true
const result = await fetchRequest('/v1/chat/completion/create', { const result = await fetchRequest('/v1/chat/completion/create', {
method: 'post', method: 'post',
......
...@@ -34,4 +34,9 @@ const handleRenderMd = () => { ...@@ -34,4 +34,9 @@ const handleRenderMd = () => {
watch( () => props.content, () => { watch( () => props.content, () => {
handleRenderMd() handleRenderMd()
}, { immediate: true }) }, { immediate: true })
</script> </script>
\ No newline at end of file <style>
.hljs {
background: transparent;
}
</style>
\ No newline at end of file
...@@ -187,6 +187,7 @@ const handleScroll = () => { ...@@ -187,6 +187,7 @@ const handleScroll = () => {
const scrollToView = () => { const scrollToView = () => {
if (!isAutoToBottom.value) return if (!isAutoToBottom.value) return
const $target = document.querySelector('#scrollElement') const $target = document.querySelector('#scrollElement')
if (!$target) return;
const height = $target.clientHeight const height = $target.clientHeight
y.value = height y.value = height
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册