From 82008e1fb85318dcbd5f8b1661f4cb401d52ae9e Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Wed, 27 Dec 2023 22:29:10 +0900 Subject: [PATCH] =?UTF-8?q?(fix)=20=E3=83=AB=E3=83=BC=E3=83=88=E9=81=B7?= =?UTF-8?q?=E7=A7=BB=E6=99=82=E3=81=AB=E4=B8=8A=E3=81=AB=E6=88=BB=E3=82=89?= =?UTF-8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/router.options.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/router.options.ts b/app/router.options.ts index 52c2b207..494ac4ff 100644 --- a/app/router.options.ts +++ b/app/router.options.ts @@ -1,12 +1,10 @@ import type { RouterConfig } from '@nuxt/schema' export default { - 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 };