feat: show custom cookbook

This commit is contained in:
YunYouJun
2023-08-20 04:59:14 +08:00
parent 98123b0039
commit 94a9ff5007
25 changed files with 333 additions and 20 deletions

View File

@@ -1,6 +1,5 @@
<script lang="ts" setup>
import type { BottomMenuItem } from '@yunlefun/vue'
import { ref } from 'vue'
const items: BottomMenuItem[] = [
{
@@ -38,9 +37,7 @@ const items: BottomMenuItem[] = [
const route = useRoute()
const router = useRouter()
const active = ref(route.path)
function onClick(item: BottomMenuItem) {
active.value = item.to || ''
router.push(item.to || '/')
}
</script>
@@ -51,7 +48,7 @@ function onClick(item: BottomMenuItem) {
v-for="item in items"
:key="item.to"
:item="item"
:active="active === item.to"
:active="route.path === item.to"
@click="onClick"
/>
</YlfBottomMenu>