lrf402788946 5 лет назад
Родитель
Сommit
0e15a3af80
2 измененных файлов с 4 добавлено и 1 удалено
  1. 2 0
      src/router/index.js
  2. 2 1
      vue.config.js

+ 2 - 0
src/router/index.js

@@ -13,6 +13,8 @@ const routes = [
 ];
 
 const router = new VueRouter({
+  mode: 'history',
+  base: process.env.NODE_ENV === 'development' ? '' : 'examine',
   routes,
 });
 

+ 2 - 1
vue.config.js

@@ -1,6 +1,7 @@
 const path = require('path');
 module.exports = {
-  publicPath: '/',
+  publicPath: process.env.NODE_ENV === 'development' ? '/' : 'examine',
+  outputDir: 'examine',
   configureWebpack: config => {
     Object.assign(config, {
       // 开发生产共同配置