修复了移动端导航栏不会自动回收的问题
All checks were successful
CI / build (push) Successful in 3m23s

This commit is contained in:
Jeffrey Hsu 2024-11-05 19:45:21 +08:00
parent 7a128ef148
commit 9d5e43d0fc
2 changed files with 12 additions and 1 deletions

View File

@ -83,6 +83,10 @@ const menuExpanded = () => {
isExpended.value = !isExpended.value
}
const menuClose = () => {
isExpended.value = false
}
</script>
<template>
@ -113,7 +117,9 @@ const menuExpanded = () => {
>
<nav-bar-entry-item v-for="item in entry" :key="item.title"
:entry="item.entry" :icon="item.icon"
:title="item.title" :to="item.to"/>
:title="item.title" :to="item.to"
@on-go="menuClose"
/>
</div>
<!-- 快速跳转小组件 -->

View File

@ -7,6 +7,10 @@ type Entry = {
to: string,
}
const emit = defineEmits<{
(e: 'onGo'): void
}>();
defineProps<{
title: string
icon: string[]
@ -20,6 +24,7 @@ const onClick = (to: string | undefined, url: boolean) => {
if (url)
window.open(to)
emit('onGo')
router.push({name: to})
}
</script>