Skip to content

Commit 84c7d28

Browse files
committed
fix: add basePath on TopPageSection links & remove basePath on GlobalHeader
1 parent 745a6ef commit 84c7d28

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

apps/web/app/components/GlobalHeader.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useRuntimeConfig, useWithBase } from '#imports'
2+
import { useRuntimeConfig } from '#imports'
33
import { useI18n } from '#i18n'
44
import { useNav } from '~/composables/useNav'
55
import { useScreenOrientation, useWindowSize } from '@vueuse/core'
@@ -36,10 +36,8 @@ const toggleMenu = () => {
3636
showMenu.value = !showMenu.value
3737
}
3838
39-
const withBase = useWithBase()
4039
const getAnchorPath = computed(
41-
() => (anchor: string) =>
42-
locale.value === 'ja' ? withBase(`/${anchor}`) : withBase(`en/${anchor}`),
40+
() => (anchor: string) => (locale.value === 'ja' ? `/${anchor}` : `/en/${anchor}`),
4341
)
4442
</script>
4543

apps/web/app/components/TopPageSection.vue

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<script setup lang="ts">
22
import { useI18n } from '#i18n'
33
import { computed } from 'vue'
4+
import { useWithBase } from '#imports'
45
56
const { locale } = useI18n()
67
8+
const withBase = useWithBase()
9+
710
const getAnchorPath = computed(
8-
() => (anchor: string) => (locale.value === 'ja' ? `/${anchor}` : `/en/${anchor}`),
11+
() => (anchor: string) =>
12+
locale.value === 'ja' ? withBase(`/${anchor}`) : withBase(`/en/${anchor}`),
913
)
1014
</script>
1115

0 commit comments

Comments
 (0)