Blame view

test/main.js 2.2 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';
7fa943eb   梁灏   init
7
8
9
10
11
12
13
14
15
16
17
18
  
  Vue.use(VueRouter);
  
  // 开启debug模式
  Vue.config.debug = true;
  
  // 路由配置
  var router = new VueRouter({
      history: true
  });
  
  router.map({
b8273bfc   jingsam   add a nav for tes...
19
      '/button': {
7fa943eb   梁灏   init
20
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
21
              require(['./routers/button.vue'], resolve);
7fa943eb   梁灏   init
22
23
          }
      },
b8273bfc   jingsam   add a nav for tes...
24
      '/card': {
7fa943eb   梁灏   init
25
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
26
              require(['./routers/card.vue'], resolve);
7fa943eb   梁灏   init
27
28
          }
      },
b8273bfc   jingsam   add a nav for tes...
29
      '/message': {
7fa943eb   梁灏   init
30
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
31
              require(['./routers/message.vue'], resolve);
7fa943eb   梁灏   init
32
33
34
35
36
37
38
          }
      },
      '/more': {
          component: function (resolve) {
              require(['./routers/more.vue'], resolve);
          }
      },
b8273bfc   jingsam   add a nav for tes...
39
      '/page': {
7fa943eb   梁灏   init
40
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
41
              require(['./routers/page.vue'], resolve);
7fa943eb   梁灏   init
42
43
          }
      },
b8273bfc   jingsam   add a nav for tes...
44
      '/poptip': {
7fa943eb   梁灏   init
45
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
46
              require(['./routers/poptip.vue'], resolve);
7fa943eb   梁灏   init
47
          }
7c15ac9e   梁灏   add Message compo...
48
      },
b8273bfc   jingsam   add a nav for tes...
49
      '/radio': {
7c15ac9e   梁灏   add Message compo...
50
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
51
              require(['./routers/radio.vue'], resolve);
7c15ac9e   梁灏   add Message compo...
52
          }
40f8606f   梁灏   add Notice component
53
      },
b8273bfc   jingsam   add a nav for tes...
54
      '/select': {
40f8606f   梁灏   add Notice component
55
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
56
              require(['./routers/select.vue'], resolve);
40f8606f   梁灏   add Notice component
57
          }
4ec205b6   梁灏   add Tag UI
58
      },
b8273bfc   jingsam   add a nav for tes...
59
      '/slider': {
4ec205b6   梁灏   add Tag UI
60
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
61
              require(['./routers/slider.vue'], resolve);
4ec205b6   梁灏   add Tag UI
62
          }
e355dd49   梁灏   add Select Component
63
      },
b8273bfc   jingsam   add a nav for tes...
64
      '/step': {
e355dd49   梁灏   add Select Component
65
          component: function (resolve) {
b8273bfc   jingsam   add a nav for tes...
66
              require(['./routers/step.vue'], resolve);
e355dd49   梁灏   add Select Component
67
          }
2af5843d   梁灏   Switch add large ...
68
69
70
71
72
      },
      '/switch': {
          component: function (resolve) {
              require(['./routers/switch.vue'], resolve);
          }
a901da64   梁灏   optimize Alert style
73
74
75
76
77
      },
      '/alert': {
          component: function (resolve) {
              require(['./routers/alert.vue'], resolve);
          }
382c000c   梁灏   Tag add type prop...
78
79
80
81
82
      },
      '/tag': {
          component: function (resolve) {
              require(['./routers/tag.vue'], resolve);
          }
7d5431d8   梁灏   update some style
83
84
85
86
87
      },
      '/input': {
          component: function (resolve) {
              require(['./routers/input.vue'], resolve);
          }
7fa943eb   梁灏   init
88
89
90
91
92
93
94
95
96
97
98
99
      }
  });
  
  router.beforeEach(function () {
      window.scrollTo(0, 0);
  });
  
  router.afterEach(function (transition) {
  
  });
  
  router.redirect({
b8273bfc   jingsam   add a nav for tes...
100
      '*': "/button"
7fa943eb   梁灏   init
101
  });
4df4ea19   jingsam   optimize project ...
102
  router.start(App, '#app');