Blame view

test/main.js 3.88 KB
7fa943eb   梁灏   init
1
2
3
4
5
  /**
   * Created by aresn on 16/6/20.
   */
  import Vue from 'vue';
  import VueRouter from 'vue-router';
4df4ea19   jingsam   optimize project ...
6
  import App from './app.vue';
c571d9ec   梁灏   add a dialog to f...
7
  import iView from '../src/index';
d509d2b2   梁灏   fixed #192
8
  // import locale from '../src/locale/lang/en-US';
e5ac7925   梁灏   update Rate
9
  import locale from '../src/locale/lang/zh-CN';
7fa943eb   梁灏   init
10
11
  
  Vue.use(VueRouter);
e5ac7925   梁灏   update Rate
12
  Vue.use(iView, { locale });
7fa943eb   梁灏   init
13
14
15
16
17
18
19
20
21
22
  
  // 开启debug模式
  Vue.config.debug = true;
  
  // 路由配置
  var router = new VueRouter({
      history: true
  });
  
  router.map({
b8273bfc   jingsam   add a nav for tes...
23
      '/button': {
7fa943eb   梁灏   init
24
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
25
              require(['./routers/button.vue'], resolve);
7fa943eb   梁灏   init
26
27
          }
      },
b8273bfc   jingsam   add a nav for tes...
28
      '/card': {
7fa943eb   梁灏   init
29
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
30
              require(['./routers/card.vue'], resolve);
7fa943eb   梁灏   init
31
32
          }
      },
b8273bfc   jingsam   add a nav for tes...
33
      '/message': {
7fa943eb   梁灏   init
34
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
35
              require(['./routers/message.vue'], resolve);
7fa943eb   梁灏   init
36
37
38
39
40
41
42
          }
      },
      '/more': {
          component: function (resolve) {
              require(['./routers/more.vue'], resolve);
          }
      },
b8273bfc   jingsam   add a nav for tes...
43
      '/page': {
7fa943eb   梁灏   init
44
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
45
              require(['./routers/page.vue'], resolve);
7fa943eb   梁灏   init
46
47
          }
      },
b8273bfc   jingsam   add a nav for tes...
48
      '/poptip': {
7fa943eb   梁灏   init
49
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
50
              require(['./routers/poptip.vue'], resolve);
7fa943eb   梁灏   init
51
          }
7c15ac9e   梁灏   add Message compo...
52
      },
b8273bfc   jingsam   add a nav for tes...
53
      '/radio': {
7c15ac9e   梁灏   add Message compo...
54
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
55
              require(['./routers/radio.vue'], resolve);
7c15ac9e   梁灏   add Message compo...
56
          }
40f8606f   梁灏   add Notice component
57
      },
b8273bfc   jingsam   add a nav for tes...
58
      '/select': {
40f8606f   梁灏   add Notice component
59
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
60
              require(['./routers/select.vue'], resolve);
40f8606f   梁灏   add Notice component
61
          }
4ec205b6   梁灏   add Tag UI
62
      },
b8273bfc   jingsam   add a nav for tes...
63
      '/slider': {
4ec205b6   梁灏   add Tag UI
64
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
65
              require(['./routers/slider.vue'], resolve);
4ec205b6   梁灏   add Tag UI
66
          }
e355dd49   梁灏   add Select Component
67
      },
b8273bfc   jingsam   add a nav for tes...
68
      '/step': {
e355dd49   梁灏   add Select Component
69
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
70
              require(['./routers/step.vue'], resolve);
e355dd49   梁灏   add Select Component
71
          }
2af5843d   梁灏   Switch add large ...
72
73
74
75
76
      },
      '/switch': {
          component: function (resolve) {
              require(['./routers/switch.vue'], resolve);
          }
a901da64   梁灏   optimize Alert style
77
78
79
80
81
      },
      '/alert': {
          component: function (resolve) {
              require(['./routers/alert.vue'], resolve);
          }
382c000c   梁灏   Tag add type prop...
82
83
84
85
86
      },
      '/tag': {
          component: function (resolve) {
              require(['./routers/tag.vue'], resolve);
          }
7d5431d8   梁灏   update some style
87
88
89
90
91
      },
      '/input': {
          component: function (resolve) {
              require(['./routers/input.vue'], resolve);
          }
650ce7b8   梁灏   optimize Tooltip ...
92
93
94
95
96
      },
      '/tooltip': {
          component: function (resolve) {
              require(['./routers/tooltip.vue'], resolve);
          }
0a48ac45   梁灏   Input add readonl...
97
98
99
100
101
      },
      '/cascader': {
          component: function (resolve) {
              require(['./routers/cascader.vue'], resolve);
          }
77f7bb95   梁灏   add Transfer comp...
102
103
104
105
106
      },
      '/transfer': {
          component: function (resolve) {
              require(['./routers/transfer.vue'], resolve);
          }
2cb8a6d9   梁灏   commit Table comp...
107
108
109
110
111
      },
      '/table': {
          component: function (resolve) {
              require(['./routers/table.vue'], resolve);
          }
ab8aaf95   梁灏   add Dropdown comp...
112
113
114
115
116
      },
      '/dropdown': {
          component: function (resolve) {
              require(['./routers/dropdown.vue'], resolve);
          }
17f52abf   梁灏   update Tabs
117
118
119
120
121
      },
      '/tabs': {
          component: function (resolve) {
              require(['./routers/tabs.vue'], resolve);
          }
e05d7289   梁灏   update Menu
122
123
124
125
126
      },
      '/menu': {
          component: function (resolve) {
              require(['./routers/menu.vue'], resolve);
          }
0f677893   梁灏   update DatePicker
127
128
129
130
131
      },
      '/date': {
          component: function (resolve) {
              require(['./routers/date.vue'], resolve);
          }
9f5e2c7e   梁灏   update Form
132
133
134
135
136
137
      },
      '/form': {
          component: function (resolve) {
              require(['./routers/form.vue'], resolve);
          }
      },
6c9acb08   Rijn   initialize carousel
138
139
140
141
142
      '/carousel': {
          component: function (resolve) {
              require(['./routers/carousel.vue'], resolve);
          }
      },
49d380cf   梁灏   init Rate component
143
144
145
146
147
      '/rate': {
          component: function (resolve) {
              require(['./routers/rate.vue'], resolve);
          }
      },
3affd6f3   梁灏   init upload compo...
148
149
150
151
152
      '/upload': {
          component: function (resolve) {
              require(['./routers/upload.vue'], resolve);
          }
      },
7fa943eb   梁灏   init
153
154
155
156
157
158
159
160
161
162
163
  });
  
  router.beforeEach(function () {
      window.scrollTo(0, 0);
  });
  
  router.afterEach(function (transition) {
  
  });
  
  router.redirect({
b8273bfc   jingsam   add a nav for tes...
164
      '*': "/button"
7fa943eb   梁灏   init
165
  });
4df4ea19   jingsam   optimize project ...
166
  router.start(App, '#app');