kbar支持历史记录

This commit is contained in:
Allen
2024-06-03 10:16:01 +08:00
parent b5e9b14048
commit 43f36f556c
2 changed files with 39 additions and 0 deletions

View File

@@ -166,6 +166,18 @@ function searchTorrent() {
emit('close')
}
// 跳转到历史记录页面
function searchHistory() {
if (!searchWord.value) return
router.push({
path: '/history',
query: {
search: searchWord.value
},
})
emit('close')
}
// 跳转插件页面
function showPlugin(pluginId: string) {
router.push({
@@ -290,6 +302,24 @@ onMounted(() => {
</VListItem>
</template>
</VHover>
<VHover>
<template #default="hover">
<VListItem
prepend-icon="mdi-history"
density="compact"
link
v-bind="hover.props"
@click="searchHistory"
>
<VListItemTitle>
搜索 <span class="font-bold">{{ searchWord }}</span> 相关的历史记录 ...
</VListItemTitle>
<template #append>
<VIcon v-if="hover.isHovering" icon="ri-corner-down-left-line" />
</template>
</VListItem>
</template>
</VHover>
<VListSubheader v-if="matchedSubscribeItems.length > 0"> 订阅 </VListSubheader>
<VHover
v-if="matchedSubscribeItems.length > 0"