#7 added errorPages
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user