(fix) ルート遷移時に上に戻らない

This commit is contained in:
kakkokari-gtyih 2023-12-27 22:29:10 +09:00
parent e2438ba03e
commit 82008e1fb8

View File

@ -1,12 +1,10 @@
import type { RouterConfig } from '@nuxt/schema'
export default <RouterConfig> {
scrollBehavior(to, from, savedPosition) {
const width = window ? window.innerWidth : 0;
scrollBehavior(to) {
if (to.meta.layout && to.hash) {
const width = window ? window.innerWidth : 0;
if (savedPosition) {
return savedPosition;
} else if (to.meta.layout && to.hash) {
switch (to.meta.layout) {
case 'blank':
return { el: to.hash };