Repair scrolling
This commit is contained in:
parent
608f44280a
commit
d4537b3b70
@ -53,7 +53,19 @@ const routes = [
|
|||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
base: process.env.BASE_URL ?? '/',
|
base: process.env.BASE_URL ?? '/',
|
||||||
routes
|
routes,
|
||||||
|
scrollBehavior (to, from, savedPosition) {
|
||||||
|
if (savedPosition) {
|
||||||
|
return savedPosition
|
||||||
|
} else if (to.hash) {
|
||||||
|
return {
|
||||||
|
selector: to.hash,
|
||||||
|
behavior: 'smooth'
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return { x: 0, y: 0 }
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const title = ' :: ' + mainTitle
|
const title = ' :: ' + mainTitle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user