File tree 3 files changed +11
-6
lines changed 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
+ import { routeWhiteList } from ' @/config/routes'
3
+
2
4
const route = useRoute ()
3
5
const router = useRouter ()
4
6
@@ -18,9 +20,7 @@ const title = computed(() => {
18
20
return route .meta .i18n ? t (route .meta .i18n ) : (route .meta .title || ' ' )
19
21
})
20
22
21
- const routeWhiteList = [' home' , ' profile' ]
22
-
23
- const showLeftArrow = computed (() => routeWhiteList .includes (route .name ))
23
+ const showLeftArrow = computed (() => route .name && routeWhiteList .includes (route .name ))
24
24
</script >
25
25
26
26
<template >
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
+ import { routeWhiteList } from ' @/config/routes'
3
+
2
4
const { t } = useI18n ()
3
5
const active = ref (0 )
4
6
const route = useRoute ()
5
7
6
- const routeWhiteList = [' home' , ' profile' ]
7
-
8
- const show = computed (() => routeWhiteList .includes (route .name ))
8
+ const show = computed (() => route .name && routeWhiteList .includes (route .name ))
9
9
</script >
10
10
11
11
<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