added base path to the vue router
This commit is contained in:
10
src/main.ts
10
src/main.ts
@@ -8,11 +8,11 @@ import Detail from '@/pages/Detail.vue'
|
|||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
routes: [
|
routes: [
|
||||||
{ path: '/', component: Home},
|
{ path: '/', component: Home },
|
||||||
{ path: '/:name', component: Detail, props: true}
|
{ path: '/:name', component: Detail, props: true }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use(router)
|
app.use(router)
|
||||||
|
|||||||
Reference in New Issue
Block a user