From 3735262f83ba523cae560cd52478b908996d162d Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期五, 12 十一月 2021 14:19:47 +0800 Subject: [PATCH] [update] 1. 跳轉頁面時 scollTop 2. GoToTop btn not work --- PAMapp/nuxt.config.js | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/PAMapp/nuxt.config.js b/PAMapp/nuxt.config.js index 70c929e..8fa0416 100644 --- a/PAMapp/nuxt.config.js +++ b/PAMapp/nuxt.config.js @@ -60,5 +60,15 @@ scss: [ '~/assets/scss/main.scss' ] + }, + router: { + scrollBehavior (to, from, savedPosition) { + if (savedPosition) { + return savedPosition; + } else { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; + } + } } } -- Gitblit v1.8.0