Browse Source

修复 构建多页面失败的问题

feat
JinxChen 2 years ago
parent
commit
1cd95cdefb
5 changed files with 21 additions and 26 deletions
  1. +1
    -1
      public/schedule.html
  2. +0
    -10
      src/pages/gaode.js
  3. +2
    -3
      src/pages/schedule/Schedule.vue
  4. +10
    -0
      src/pages/schedule/schedule.js
  5. +8
    -12
      vue.config.js

public/gaode.html → public/schedule.html View File

@@ -147,6 +147,6 @@
marker.on('dragging',compute)
map.setFitView();
</script>
<div id="gaode"></div>
<div id="schedule"></div>
</body>
</html>

+ 0
- 10
src/pages/gaode.js View File

@@ -1,10 +0,0 @@
import Vue from 'vue';
import gaode from './gaode.vue';
import router from '../router';
import store from '../store';
Vue.config.productionTip = false;
new Vue({
router,
store,
render: (h) => h(gaode),
}).$mount("#gaode");

src/pages/gaode.vue → src/pages/schedule/Schedule.vue View File

@@ -1,11 +1,10 @@
<template>
<div id="gaode">
</div>
<div id="schedule"></div>
</template>

<script>
export default {
name:'gaode',
name:'',
data(){
return {


+ 10
- 0
src/pages/schedule/schedule.js View File

@@ -0,0 +1,10 @@
import Vue from 'vue';
import Schedule from './Schedule.vue';
import router from '../../router';
import store from '../../store';
Vue.config.productionTip = false;
new Vue({
router,
store,
render: (h) => h(Schedule),
}).$mount("#schedule");

+ 8
- 12
vue.config.js View File

@@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2020-04-15 10:00:32
* @LastEditTime: 2022-05-11 14:56:49
* @LastEditTime: 2022-05-11 15:35:24
* @LastEditors: JinxChen
* @Description: In User Settings Edit
* @FilePath: \AntpayFrontEnd\vue.config.js
@@ -10,29 +10,25 @@ const port = process.env.port || process.env.npm_config_port || 8080;/* 7788 */

module.exports = {
// 注意: 多页面配置 不再使用全路径,单页面时可以开启
publicPath: './',
/* publicPath: './', */
outputDir: 'dist',
// assetsDir: 'static',
// lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,
// 多页面配置
pages: {
// 先配置主页
// 先配置主页
index: {
entry: './src/main.js',
template: './public/index.html',
/* title: '用户登录' */
chunks: ['chunk-vendors', 'chunk-common', 'index'],
subpage: 'src/main.js'
},
// 再配置各个子页面:登录后课表查询页
gaode: {
entry: './src/pages/gaode.js',
template: './public/gaode.html',
title: '高德地图demo',
/* chunks: ['chunk-vendors', 'chunk-common', 'gaode'],
subpage: 'src/pages/gaode.js' */
}
schedule: {
entry: './src/pages/schedule/schedule.js',
template: './public/schedule.html',
title: '高德地图demo'
},
},
devServer: {
port: port,


Loading…
Cancel
Save