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/nuxt.config.js |   21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/PAMapp/nuxt.config.js b/PAMapp/nuxt.config.js
index d204e9f..33f59f2 100644
--- a/PAMapp/nuxt.config.js
+++ b/PAMapp/nuxt.config.js
@@ -21,15 +21,16 @@
       { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
     ]
   },
-
+  layoutTransition:'pam-fade-in',
+  pageTransition:'pam-fade-in',
   // Global CSS: https://go.nuxtjs.dev/config-css
   css: [
     'element-ui/lib/theme-chalk/index.css',
     'swiper/css/swiper.css',
     'vue-scroll-picker/dist/style.css',
     '~/assets/scss/main.scss',
+    '~/assets/pam-animation.css'
   ],
-
   // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
   plugins: [
     '~/plugins/element-ui.js',
@@ -49,7 +50,9 @@
     // https://go.nuxtjs.dev/typescript
     '@nuxt/typescript-build',
     '@nuxtjs/axios',
-    '@nuxtjs/style-resources'
+    '@nuxtjs/style-resources',
+    ['@nuxtjs/dotenv', { filename: '.env.' + process.env.ENV }],
+
   ],
 
   // Modules: https://go.nuxtjs.dev/config-modules
@@ -65,16 +68,6 @@
     ]
   },
   router: {
-    scrollBehavior (to, from, savedPosition) {
-      if (savedPosition) {
-        return savedPosition;
-      } else {
-        document.body.scrollTop = 0;
-        document.documentElement.scrollTop = 0;
-      }
-    }
-  },
-  env: {
-    BASE_URL: 'http://localhost:8080/api'
+    base: process.env.ENV === 'uat' ? '/pam/' : ''
   }
 }

--
Gitblit v1.8.0