feat: init wechat

This commit is contained in:
yanghao05
2025-04-16 20:58:26 +08:00
parent 92a070cc81
commit 85301c8994
22 changed files with 841 additions and 1 deletions

View File

@@ -0,0 +1,49 @@
<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const activeTab = ref(0)
const tabs = [
{ label: '列表', route: '/' },
{ label: '已购买', route: '/purchased' },
{ label: '我的', route: '/profile' }
]
const switchTab = (index) => {
activeTab.value = index
router.push(tabs[index].route)
}
</script>
<template>
<div class="layout">
<div class="content">
<router-view v-slot="{ Component }">
<keep-alive>
<component :is="Component" />
</keep-alive>
</router-view>
</div>
<TabMenu :model="tabs" :activeIndex="activeTab" @tab-change="switchTab" class="bottom-tabs" />
</div>
</template>
<style scoped>
.layout {
display: flex;
flex-direction: column;
height: 100vh;
}
.content {
flex: 1;
overflow-y: auto;
}
.bottom-tabs {
border-top: 1px solid #eee;
}
</style>