From df0b661216028e6b44c55e94e0f8d601be9a8802 Mon Sep 17 00:00:00 2001 From: Mila <Mila@pollex.com.tw> Date: 星期四, 25 十一月 2021 12:28:40 +0800 Subject: [PATCH] 1. 設定 uat router base 2. fix: run generate warn (router.scrollBehavior property is deprecated in favor of using ~/app/router.scrollBehavior.js file) --- PAMapp/app/router.scrollBehavior.js | 8 ++++++++ PAMapp/nuxt.config.js | 9 +-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/PAMapp/app/router.scrollBehavior.js b/PAMapp/app/router.scrollBehavior.js new file mode 100644 index 0000000..b5f96c9 --- /dev/null +++ b/PAMapp/app/router.scrollBehavior.js @@ -0,0 +1,8 @@ +export default function (to, from, savedPosition) { + if (savedPosition) { + return savedPosition; + } else { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; + } +} \ No newline at end of file diff --git a/PAMapp/nuxt.config.js b/PAMapp/nuxt.config.js index b151e66..33f59f2 100644 --- a/PAMapp/nuxt.config.js +++ b/PAMapp/nuxt.config.js @@ -68,13 +68,6 @@ ] }, router: { - scrollBehavior (to, from, savedPosition) { - if (savedPosition) { - return savedPosition; - } else { - document.body.scrollTop = 0; - document.documentElement.scrollTop = 0; - } - } + base: process.env.ENV === 'uat' ? '/pam/' : '' } } -- Gitblit v1.8.0