@@ -35,6 +35,14 @@ const Register = resolve =>{
35
35
})
36
36
}
37
37
*/
38
+ const DashBoard = ( ) => System . import ( '../components/Dashboard' ) ;
39
+ const TheContainer = ( ) => System . import ( '../containers/TheContainer' ) ;
40
+ const ProductPurchase = ( ) => System . import ( '../components/ProductPurchase' ) ;
41
+ const ProductSell = ( ) => System . import ( '../components/ProductSell' ) ;
42
+ const UserConfirmation = ( ) => System . import ( '../components/UserConfirmation' ) ;
43
+ const Login = ( ) => System . import ( '../components/Login' ) ;
44
+ const Register = ( ) => System . import ( '../components/Register' ) ;
45
+
38
46
39
47
Vue . use ( VueRouter ) ;
40
48
@@ -45,15 +53,15 @@ const routes = [
45
53
path : '/' ,
46
54
redirect : '/dashboard' ,
47
55
name : 'Home' ,
48
- component : ( ) => System . import ( '../containers/ TheContainer' ) ,
56
+ component : TheContainer ,
49
57
beforeEnter ( to , from , next ) {
50
58
controlLogin ( next ) ;
51
59
} ,
52
60
children : [
53
61
{
54
62
path : 'dashboard' ,
55
63
name : 'Dashboard' ,
56
- component : ( ) => System . import ( '../components/Dashboard' ) ,
64
+ component : DashBoard ,
57
65
beforeEnter ( to , from , next ) {
58
66
controlLogin ( next ) ;
59
67
}
@@ -79,15 +87,15 @@ const routes = [
79
87
{
80
88
path : "purchase" ,
81
89
name : "ProductPurchase" ,
82
- component : ( ) => System . import ( '../components/ ProductPurchase' ) ,
90
+ component : ProductPurchase ,
83
91
beforeEnter ( to , from , next ) {
84
92
controlLogin ( next ) ;
85
93
}
86
94
} ,
87
95
{
88
96
path : "sell" ,
89
97
name : "ProductSell" ,
90
- component : ( ) => System . import ( '../components/ ProductSell' ) ,
98
+ component : ProductSell ,
91
99
beforeEnter ( to , from , next ) {
92
100
controlLogin ( next ) ;
93
101
}
@@ -99,15 +107,15 @@ const routes = [
99
107
{
100
108
path : "/user/registrationConfirm" ,
101
109
name : "UserConfirmation" ,
102
- component : ( ) => System . import ( '../components/ UserConfirmation' ) ,
110
+ component : UserConfirmation ,
103
111
children : [
104
- { path : ":param" , component : ( ) => System . import ( '../components/ UserConfirmation' ) }
112
+ { path : ":param" , component : UserConfirmation }
105
113
]
106
114
} ,
107
115
{
108
116
path : "/login" ,
109
117
name : "Login" ,
110
- component : ( ) => System . import ( '../components/ Login' ) ,
118
+ component : Login ,
111
119
beforeEnter ( to , from , next ) {
112
120
initSet ( ) ;
113
121
if ( store . getters . getIsLogin && util . common . getToken ( ) != null ) {
@@ -120,7 +128,7 @@ const routes = [
120
128
{
121
129
path : "/register" ,
122
130
name : "Register" ,
123
- component : ( ) => System . import ( '../components/ Register' ) ,
131
+ component : Register ,
124
132
} ,
125
133
{
126
134
path : "*" , redirect : "/dashboard" ,
0 commit comments