Blame view

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