调试
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 11s
Docker Build & Deploy / Deploy to Production (push) Successful in 6s

This commit is contained in:
孙诚
2025-12-25 16:37:09 +08:00
parent 2f79913dc5
commit 45dd65c88b

View File

@@ -1,5 +1,5 @@
<template> <template>
<van-config-provider :theme="theme" style="height: 100vh;"> <van-config-provider :theme="theme" :style="{ height: vh }">
<RouterView /> <RouterView />
<van-tabbar v-model="active" v-show="showTabbar"> <van-tabbar v-model="active" v-show="showTabbar">
<van-tabbar-item icon="notes-o" to="/calendar"> <van-tabbar-item icon="notes-o" to="/calendar">
@@ -22,11 +22,30 @@
import { RouterView, useRoute } from 'vue-router' import { RouterView, useRoute } from 'vue-router'
import { ref, onMounted, onUnmounted, computed } from 'vue' import { ref, onMounted, onUnmounted, computed } from 'vue'
const vh = ref('100vh')
const setVh = () => {
// 实际可视高度,能更好适配 iOS、PWA 等场景
vh.value = window.innerHeight + 'px'
}
onMounted(() => {
setVh()
window.addEventListener('resize', setVh)
})
onUnmounted(() => {
window.removeEventListener('resize', setVh)
})
const route = useRoute() const route = useRoute()
// 根据路由判断是否显示Tabbar // 根据路由判断是否显示Tabbar
const showTabbar = computed(() => { const showTabbar = computed(() => {
return route.path !== '/login' return route.path === '/' ||
route.path === '/calendar' ||
route.path === '/email' ||
route.path === '/setting'
}) })
const active = ref(0) const active = ref(0)