#7 added errorPages
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good

This commit is contained in:
2021-11-23 10:33:24 +01:00
parent 21bf749556
commit 44d6a97fb4
12 changed files with 151 additions and 83 deletions

View File

@@ -8,6 +8,10 @@ function lazyLoadComponent(view) {
return () => import(`@/components/${view}.vue`)
}
function lazyLoadErrorPages(view) {
return () => import(`@/views/errorPages/${view}.vue`)
}
const routes = [
{
path: '/',
@@ -75,13 +79,27 @@ const routes = [
score: lazyLoadComponent('DamageSite')
}
}
],
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return {x: 0, y: 0}
}
]
},
{
path: '/404',
name: '404',
components: {
main: lazyLoadErrorPages('404')
}
},
{
path: '/500',
name: '500',
components: {
main: lazyLoadErrorPages('500')
}
},
{
path: '/502',
name: '502',
components: {
main: lazyLoadErrorPages('502')
}
},
{
@@ -92,7 +110,14 @@ const routes = [
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
routes,
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition
} else {
return {x: 0, y: 0}
}
}
})
export default router