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

add

上级 cedb5f06
...@@ -16,23 +16,7 @@ ...@@ -16,23 +16,7 @@
label="收藏夹" label="收藏夹"
to="/library" to="/library"
/> />
<div class="flex justify-between"> <ISearchHistory @sign="handleOpenSign" />
<UButton
class="flex-grow"
leading-icon="i-heroicons-magnifying-glass"
color="gray"
variant="ghost"
size="md"
label="搜索记录"
@click="handleOpenSearchHistory"
/>
<UButton
v-if="$isSignIn"
label="清空"
size="md"
variant="link"
/>
</div>
<div v-if="$isSignIn" class="flex flex-col gap-2 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5"> <div v-if="$isSignIn" class="flex flex-col gap-2 border-l border-gray-200 dark:border-gray-800 pl-2 ml-5">
<template v-for="(item, index) in searchHistory" :key="index"> <template v-for="(item, index) in searchHistory" :key="index">
<UButton <UButton
...@@ -83,10 +67,4 @@ const handleOpenSign = () => { ...@@ -83,10 +67,4 @@ const handleOpenSign = () => {
const handleCloseSign = () => { const handleCloseSign = () => {
isOpenSign.value = false isOpenSign.value = false
} }
const handleOpenSearchHistory = () => {
if (!$isSignIn) handleOpenSign()
else {
}
}
</script> </script>
<template>
<div class="flex justify-between">
<UButton
class="flex-grow"
leading-icon="i-heroicons-magnifying-glass"
color="gray"
variant="ghost"
size="md"
label="搜索记录"
@click="handleOpen"
/>
<UButton
v-if="$isSignIn"
label="清空"
size="md"
variant="link"
@click="handleClear"
/>
</div>
</template>
<script setup>
const emits = defineEmits(['sign', 'clear'])
const { $isSignIn } = useUserStore()
function handleClear () {
emits('clear')
}
function handleOpen () {
if (!$isSignIn) emits('sign')
}
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册