Blame view

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