Skip to content

Commit 5ae2e0d

Browse files
committed
fix: use app baseURL for configuring ion router
1 parent 8a1c959 commit 5ae2e0d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/runtime/router.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ import {
44
createMemoryHistory,
55
} from '@ionic/vue-router'
66

7-
import { defineNuxtPlugin } from '#imports'
7+
import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
88
import routes from '#build/routes'
99

1010
export default defineNuxtPlugin(nuxtApp => {
11+
const config = useRuntimeConfig()
12+
const baseURL = config.app.baseURL
1113
const router = createRouter({
12-
history: process.server ? createMemoryHistory('/') : createWebHistory('/'),
14+
history: process.server
15+
? createMemoryHistory(baseURL)
16+
: createWebHistory(baseURL),
1317
routes,
1418
})
1519

0 commit comments

Comments
 (0)