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

Update Create.vue

上级 7568a5cf
...@@ -22,14 +22,27 @@ ...@@ -22,14 +22,27 @@
value-attribute="label" value-attribute="label"
option-attribute="label" option-attribute="label"
> >
<UButton color="gray" variant="ghost" trailing-icon="i-heroicons-chevron-down-20-solid" :label="selectedRepo || '选择 GitHub 项目'" /> <UButton color="gray" variant="ghost" :class="{ 'group': selectedRepo }">
<span>{{ selectedRepo || '选择 GitHub 项目' }}</span>
<UIcon name="i-heroicons-chevron-down-20-solid" class="text-xl flex group-hover:hidden" />
<UButton
v-if="selectedRepo"
class="hidden group-hover:flex"
@click.stop.prevent="handleClearRepo"
icon="i-heroicons-x-mark-20-solid"
:padded="false"
color="gray"
variant="link"
/>
</UButton>
</USelectMenu> </USelectMenu>
<UButton <UButton
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 === ''" :disabled="query === ''"
>搜索</UButton> label="搜索"
/>
</div> </div>
</UCard> </UCard>
</div> </div>
...@@ -72,6 +85,9 @@ const handleSearch = async () => { ...@@ -72,6 +85,9 @@ const handleSearch = async () => {
$getSearchHistory() $getSearchHistory()
}) })
} }
function handleClearRepo () {
selectedRepo.value = ''
}
nextTick(async () => { nextTick(async () => {
if (!$repos.value.length) { if (!$repos.value.length) {
const { data } = await useRequest('/v1/chat/repository') const { data } = await useRequest('/v1/chat/repository')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册