2025-01-09 11:01:35 +00:00
|
|
|
<script setup>
|
2025-01-23 05:56:18 +00:00
|
|
|
import { useAppFooterRouteNames as names } from '@/config/index.js'
|
|
|
|
import MyIcon from "@/components/icons/MyIcon.vue";
|
|
|
|
import HomeIcon from "@/components/icons/HomeIcon.vue";
|
2025-01-08 05:26:12 +00:00
|
|
|
const route = useRoute()
|
|
|
|
const active = ref(0)
|
|
|
|
const show = computed(() => {
|
|
|
|
if (route.name && names.includes(route.name))
|
|
|
|
return true
|
|
|
|
return false
|
|
|
|
})
|
2025-01-13 02:55:10 +00:00
|
|
|
const initData=()=>{
|
2025-01-21 06:16:54 +00:00
|
|
|
active.value=route.path==='/profile'?1:0
|
2025-01-13 02:55:10 +00:00
|
|
|
}
|
2025-02-10 07:47:26 +00:00
|
|
|
watchEffect(initData)
|
2025-01-21 06:16:54 +00:00
|
|
|
onMounted(()=>{
|
|
|
|
initData()
|
|
|
|
})
|
2025-01-08 05:26:12 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2025-01-23 07:28:31 +00:00
|
|
|
<div v-if="show" v-memo="[active]" >
|
2025-01-15 01:30:29 +00:00
|
|
|
<van-tabbar v-model="active" route placeholder fixed>
|
2025-01-09 11:01:35 +00:00
|
|
|
<van-tabbar-item replace to="/">
|
|
|
|
<span>{{ $t('tabbar.home') }}</span>
|
|
|
|
<template #icon>
|
|
|
|
<HomeIcon :active="active===0"></HomeIcon>
|
|
|
|
</template>
|
|
|
|
</van-tabbar-item>
|
|
|
|
<van-tabbar-item replace to="/profile">
|
|
|
|
<span>{{ $t('tabbar.profile') }}</span>
|
|
|
|
<template #icon>
|
|
|
|
<MyIcon :active="active===1"></MyIcon>
|
|
|
|
</template>
|
|
|
|
</van-tabbar-item>
|
|
|
|
</van-tabbar>
|
|
|
|
</div>
|
2025-01-08 05:26:12 +00:00
|
|
|
</template>
|