-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabBar.vue
More file actions
38 lines (35 loc) · 1.04 KB
/
Copy pathTabBar.vue
File metadata and controls
38 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<script setup lang="ts">
import { routeWhiteList } from '@/config/routes'
const { t } = useI18n()
const active = ref(0)
const route = useRoute()
const show = computed(() => route.name && routeWhiteList.includes(route.name))
</script>
<template>
<van-tabbar v-if="show" v-model="active" route placeholder>
<van-tabbar-item replace to="/">
{{ t('layouts.home') }}
<template #icon>
<div class="i-carbon:home" />
</template>
</van-tabbar-item>
<van-tabbar-item replace to="/repair">
{{ t('layouts.repair') }}
<template #icon>
<div class="i-carbon:tool-kit" />
</template>
</van-tabbar-item>
<van-tabbar-item replace to="/workbench">
{{ t('layouts.workbench') || '工作台' }}
<template #icon>
<div class="i-carbon:dashboard" />
</template>
</van-tabbar-item>
<van-tabbar-item replace to="/profile">
{{ t('layouts.profile') }}
<template #icon>
<div class="i-carbon:user" />
</template>
</van-tabbar-item>
</van-tabbar>
</template>