mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-06-06 14:23:59 +02:00
no 404 on refresh
This commit is contained in:
@@ -3,6 +3,15 @@ import HomeView from '../views/HomeView.vue'
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
if (to.hash) {
|
||||
return {
|
||||
el: to.hash,
|
||||
behavior: 'smooth',
|
||||
}
|
||||
}
|
||||
return { top: 0 }
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: '/',
|
||||
@@ -27,6 +36,16 @@ const router = createRouter({
|
||||
name: 'report',
|
||||
component: () => import('../views/ReportView.vue')
|
||||
},
|
||||
{
|
||||
path: '/contact',
|
||||
name: 'contact',
|
||||
component: () => import('../views/ContactView.vue')
|
||||
},
|
||||
{
|
||||
path: '/roadmap',
|
||||
name: 'roadmap',
|
||||
component: () => import('../views/RoadmapView.vue')
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user