Browse Source

fix: webpack config to add output default url

pull/17/head
Tyler Chen 4 years ago
parent
commit
0904f5d380
5 changed files with 43 additions and 16 deletions
  1. +10
    -0
      src/_pages/Layout.vue
  2. +9
    -0
      src/_pages/auth/Login.vue
  3. +19
    -15
      src/_router/index.js
  4. +1
    -1
      src/app/App.vue
  5. +4
    -0
      webpack.config.js

+ 10
- 0
src/_pages/Layout.vue View File

@@ -0,0 +1,10 @@
<template>
<div>
default Layout
<router-view></router-view>
</div>
</template>

<script>
export default {};
</script>

+ 9
- 0
src/_pages/auth/Login.vue View File

@@ -0,0 +1,9 @@
<template>
<div>
New Login Page
</div>
</template>

<script>
export default {};
</script>

+ 19
- 15
src/_router/index.js View File

@@ -42,7 +42,6 @@ import FreePayment from '~/account/payment/FreePayment';
import UnknownPayment from '~/account/payment/UnknownPayment';
import { util } from '~/_helpers';


Vue.use(Router);

const paymentMethods = {
@@ -69,22 +68,28 @@ export const router = new Router({
routes: [
// new Pages & lazy loading
{
path: '/',
component: () => import('~/_pages/auth/Layout'),
path: '/new_pages',
component: () => import('~/_pages/Layout'),
children: [
{
path: '/newLogin',
component: () => import('~/_pages/auth/NewLogin'),
path: '',
component: () => import('~/_pages/auth/Layout'),
children: [
{
path: 'login',
component: () => import('~/_pages/auth/Login'),
},
],
},
],
},
{
path: '/',
component: () => import('~/_pages/main/Layout'),
children: [
{
path: '/test',
component: () => import('~/_pages/main/Test'),
path: '',
component: () => import('~/_pages/main/Layout'),
children: [
{
path: 'test',
component: () => import('~/_pages/main/Test'),
},
],
},
],
},
@@ -192,8 +197,7 @@ const publicPages = [
'/legal',

// new Pages
'/newLogin',
'/test',
'/new_pages',
];

router.beforeEach((to, from, next) => {


+ 1
- 1
src/app/App.vue View File

@@ -166,7 +166,7 @@ export default {
return this.configs ? this.configs.awaitingRestore : undefined;
},
isNewPage() {
const newPages = ['/newLogin', '/test'];
const newPages = ['/new_pages'];
console.log(this.$route);
return (
newPages.includes(this.$route.path) ||


+ 4
- 0
webpack.config.js View File

@@ -52,6 +52,10 @@ module.exports = {
],
devServer: {
historyApiFallback: true,
publicPath: '/',
},
output: {
publicPath: '/',
},
externals: {
// global app config object


Loading…
Cancel
Save