[READ-ONLY] Mirror of https://github.com/danielroe/dwaring87-webdev-wedding. Marissa & David's Wedding Website!
557 B
23 lines
1import type { RouterConfig } from '@nuxt/schema'
2
3// https://router.vuejs.org/api/#routeroptions
4export default <RouterConfig> {
5 scrollBehavior(to, _from, savedPosition) {
6 return new Promise((resolve, _reject) => {
7 setTimeout(() => {
8 if (savedPosition) {
9 resolve(savedPosition)
10 } else {
11 if (to.hash) {
12 resolve({
13 el: to.hash,
14 top: 80
15 })
16 } else {
17 resolve({ top: 0 })
18 }
19 }
20 }, 100)
21 })
22 }
23}