feat 添加历史记录搜索提示

This commit is contained in:
jokin
2023-11-29 12:17:02 +08:00
parent cfaf414f1c
commit 408eb06f8d

View File

@@ -40,6 +40,9 @@ const dataList = ref<TransferHistory[]>([])
// 搜索
const search = ref('')
// 搜索提示词列表
const searchHintList = ref<string[]>([])
// 加载状态
const loading = ref(false)
@@ -89,6 +92,7 @@ async function fetchData({
dataList.value = result.data.list
totalItems.value = result.data.total
searchHintList.value = [...new Set(dataList.value.map(item => item.title || ''))].filter(title => title !== '')
}
catch (error) {
console.error(error)
@@ -262,9 +266,10 @@ const dropdownItems = ref([
<VRow>
<VCol> 历史记录 </VCol>
<VCol>
<VTextField
<VCombobox
key="search_navbar"
v-model="search"
:items="searchHintList"
class="text-disabled"
density="compact"
label="搜索"
@@ -274,6 +279,7 @@ const dropdownItems = ref([
hide-details
flat
rounded
clearable
/>
</VCol>
</VRow>