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

update

上级 ec8e7716
......@@ -7,6 +7,7 @@
size="md"
label="首页"
to="/"
@click="handleClickItem"
/>
<UButton
leading-icon="i-heroicons-rectangle-stack"
......@@ -15,6 +16,7 @@
size="md"
label="收藏夹"
to="/library"
@click="handleClickItem"
/>
<ISearchHistory @sign="handleOpenSign" />
<UButton
......@@ -31,11 +33,16 @@
</template>
<script setup>
const { $isSignIn } = useUserStore()
const Layout = inject('Layout')
const isOpenSign = ref(false)
const handleOpenSign = () => {
isOpenSign.value = true
handleClickItem()
}
const handleCloseSign = () => {
isOpenSign.value = false
}
function handleClickItem () {
Layout.handleToggleAside()
}
</script>
......@@ -24,6 +24,7 @@
variant="ghost"
size="xs"
:to="'/search/' + item.url"
@click="handleClickItem"
>
<div class="truncate">{{ item.title }}</div>
</UButton>
......@@ -65,6 +66,7 @@
</template>
<script setup>
const emits = defineEmits(['sign', 'clear'])
const Layout = inject('Layout')
const { $isSignIn } = useUserStore()
const searchHistory = ref([
{
......@@ -98,4 +100,7 @@ function handleOpen () {
function handleClose () {
isOpenHistory.value = false
}
function handleClickItem () {
Layout.handleToggleAside()
}
</script>
......@@ -12,7 +12,7 @@
class="fixed top-2 left-2 z-20"
color="white"
trailing-icon="i-heroicons-bars-3-20-solid"
@click="handleToogleAside"
@click="handleToggleAside"
/>
<USlideover
class="w-64"
......@@ -24,7 +24,7 @@
class="absolute top-2 right-2 z-20"
color="white"
trailing-icon="i-heroicons-x-mark-20-solid"
@click="handleToogleAside"
@click="handleToggleAside"
/>
<IAside />
</USlideover>
......@@ -32,7 +32,10 @@
</template>
<script setup>
const isOpenAside = ref(false)
const handleToogleAside = () => {
const handleToggleAside = () => {
isOpenAside.value = !isOpenAside.value
}
provide('Layout', {
handleToggleAside
})
</script>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册