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

Update SearchHistory.vue

上级 c7150c80
......@@ -10,7 +10,6 @@
label="搜索记录"
/>
<UButton
v-if="$isSignIn"
class="hidden group-hover:flex"
label="清空"
size="md"
......@@ -18,28 +17,29 @@
@click="handleClear"
/>
</div>
<div v-if="$isSignIn" class="flex overflow-y-auto flex-col gap-1 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5">
<template v-for="(item, index) in $searchHistory" :key="index">
<UButton
class="flex text-gray-400"
color="gray"
variant="ghost"
size="xs"
long
:to="`/search/${item.c_id}`"
@click="handleClickItem"
>
<div class="flex-grow truncate">{{ item.title }}</div>
</UButton>
</template>
</div>
<ClientOnly>
<div class="flex overflow-y-auto flex-col gap-1 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5">
<template v-for="(item, index) in $searchHistory" :key="index">
<UButton
class="flex text-gray-400"
color="gray"
variant="ghost"
size="xs"
long
:to="`/search/${item.c_id}`"
@click="handleClickItem"
>
<div class="flex-grow truncate">{{ item.title }}</div>
</UButton>
</template>
</div>
</ClientOnly>
</div>
</template>
<script setup>
const emits = defineEmits(['sign', 'clear'])
const Layout = inject('Layout')
const modal = useModal()
const { $isSignIn } = storeToRefs(useUserStore())
const { $searchHistory } = storeToRefs(useSearchStore())
const { $clearSearchHistory } = useSearchStore()
const query = ref('')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册