File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2+ import { routeWhiteList } from ' @/config/routes'
3+
24const route = useRoute ()
35const router = useRouter ()
46
@@ -18,9 +20,7 @@ const title = computed(() => {
1820 return route .meta .i18n ? t (route .meta .i18n ) : (route .meta .title || ' ' )
1921})
2022
21- const routeWhiteList = [' home' , ' profile' ]
22-
23- const showLeftArrow = computed (() => routeWhiteList .includes (route .name ))
23+ const showLeftArrow = computed (() => route .name && routeWhiteList .includes (route .name ))
2424 </script >
2525
2626<template >
Original file line number Diff line number Diff line change 11<script setup lang="ts">
2+ import { routeWhiteList } from ' @/config/routes'
3+
24const { t } = useI18n ()
35const active = ref (0 )
46const route = useRoute ()
57
6- const routeWhiteList = [' home' , ' profile' ]
7-
8- const show = computed (() => routeWhiteList .includes (route .name ))
8+ const show = computed (() => route .name && routeWhiteList .includes (route .name ))
99 </script >
1010
1111<template >
Original file line number Diff line number Diff line change 1+ // 定义导航栏和标签栏可见的路由白名单
2+ export const routeWhiteList : readonly string [ ] = [
3+ 'home' , // 首页
4+ 'profile' , // 个人中心
5+ ]
You can’t perform that action at this time.
0 commit comments