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

Update index.vue

上级 db1b7458
...@@ -5,37 +5,26 @@ ...@@ -5,37 +5,26 @@
autoresize autoresize
placeholder="输入搜索内容..." placeholder="输入搜索内容..."
/> />
<UDropdown <div class="flex justify-between">
:items="repos" <USelectMenu
:popper="{ placement: 'bottom-start' }" class="min-w-40"
> v-model="selectedRepo"
<UButton :options="repos"
color="white" placeholder="选择 GitHub 项目"
:label="selectedRepo ? selectedRepo : '选择 GitHub 项目'" searchable
trailing-icon="i-heroicons-chevron-down-20-solid"
/> />
<template #repo="{ item }"> <UButton
<div @click="handleSelectRepo(item.label)">{{ item.label }}</div> trailing-icon="i-heroicons-chevron-right-20-solid"
</template> @click="handleSearch"
</UDropdown> >搜索</UButton>
</div>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
const repos = [ const repos = ['keycloak', 'ViewUIPlus']
[
{
label: 'keycloak',
slot: 'repo'
},
{
label: 'ViewUIPlus',
slot: 'repo'
}
]
]
const selectedRepo = ref(null) const selectedRepo = ref(null)
const handleSelectRepo = (repo) => { const handleSearch = () => {
selectedRepo.value = repo;
} }
</script> </script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册