From 06f1f53dad354becefd9b5ffaab37759515156a9 Mon Sep 17 00:00:00 2001 From: Zheng Jie <201507802@qq.com> Date: Tue, 22 Mar 2022 11:19:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E7=BA=A7=E7=9B=AE=E5=BD=95=E9=83=A8?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + public/index.html | 1 + src/router/routers.js | 5 +++-- vue.config.js | 5 ++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 78a752d..1978bc2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules/ dist/ +demo/ npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/public/index.html b/public/index.html index 89f8344..21a98ec 100644 --- a/public/index.html +++ b/public/index.html @@ -1,6 +1,7 @@ + diff --git a/src/router/routers.js b/src/router/routers.js index 8a4cf6c..5a24848 100644 --- a/src/router/routers.js +++ b/src/router/routers.js @@ -61,8 +61,9 @@ export const constantRouterMap = [ ] export default new Router({ - // mode: 'hash', - mode: 'history', + mode: 'hash', + base: '/demo/', + // mode: 'history', scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap }) diff --git a/vue.config.js b/vue.config.js index 820dd10..ebdc313 100644 --- a/vue.config.js +++ b/vue.config.js @@ -12,9 +12,8 @@ const port = 8013 // 端口配置 // All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports = { // hash 模式下可使用 - // publicPath: process.env.NODE_ENV === 'development' ? '/' : './', - publicPath: '/', - outputDir: 'dist', + publicPath: process.env.NODE_ENV === 'development' ? '/' : '/demo/', + outputDir: 'demo', assetsDir: 'static', lintOnSave: process.env.NODE_ENV === 'development', productionSourceMap: false,