File tree 6 files changed +36
-23
lines changed
6 files changed +36
-23
lines changed Original file line number Diff line number Diff line change 1
1
import './index.scss' ;
2
+
2
3
import Vue from 'vue' ;
3
- import VueRouter from 'vue-router' ;
4
- import routes from './routes/index' ;
4
+ import router from './router' ;
5
5
import Web from './web.vue' ;
6
6
7
- Vue . use ( VueRouter ) ;
8
-
9
- const router = new VueRouter ( {
10
- mode : 'history' ,
11
- routes
12
- } ) ;
13
-
14
7
new Vue ( {
15
- el : '#app' ,
16
- components : { Web } ,
17
- template : '<web/>' ,
8
+ render : h => h ( Web ) ,
18
9
router
19
- } ) ;
10
+ } ) . $mount ( '#app' ) ;
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <h1 >404 Page Not Found</h1 >
4
+ </div >
5
+ </template >
Original file line number Diff line number Diff line change
1
+ import Root from './index.vue' ;
2
+ import NotFound from './404.vue' ;
3
+
4
+ export default [
5
+ {
6
+ path : '/' ,
7
+ component : Root
8
+ } ,
9
+ {
10
+ path : '*' ,
11
+ component : NotFound
12
+ }
13
+ ] ;
Original file line number Diff line number Diff line change
1
+ import Vue from 'vue' ;
2
+ import Router from 'vue-router' ;
3
+ import routes from './pages/routes' ;
4
+
5
+ Vue . use ( Router ) ;
6
+
7
+ export default new Router ( {
8
+ mode : 'history' ,
9
+ routes
10
+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ module.exports = {
12
12
entry : './src/index.js' ,
13
13
output : {
14
14
filename : 'bundle.js' ,
15
- path : dist
15
+ path : dist ,
16
+ publicPath : '/'
16
17
} ,
17
18
module : {
18
19
rules : [
@@ -79,6 +80,7 @@ module.exports = {
79
80
devServer : {
80
81
open : true ,
81
82
contentBase : dist ,
82
- watchContentBase : true
83
+ watchContentBase : true ,
84
+ historyApiFallback : true
83
85
}
84
86
} ;
You can’t perform that action at this time.
0 commit comments