Blame view

examples/routers/table.vue 2.51 KB
2cb8a6d9   梁灏   commit Table comp...
1
  <template>
4098c176   Aresn   update Table
2
      <Table border :columns="columns5" :data="data5"></Table>
2cb8a6d9   梁灏   commit Table comp...
3
4
  </template>
  <script>
08fd628d   Aresn   Table support expand
5
      import etable from '../components/table.vue';
4098c176   Aresn   update Table
6
      import test from '../components/test.vue';
2cb8a6d9   梁灏   commit Table comp...
7
      export default {
2cb8a6d9   梁灏   commit Table comp...
8
9
          data () {
              return {
4098c176   Aresn   update Table
10
                  columns5: [
10d3a323   Aresn   fixed #1011
11
                      {
08fd628d   Aresn   Table support expand
12
                          type: 'expand',
4098c176   Aresn   update Table
13
                          render: (h) => {
e40c5352   Aresn   fixed #1195
14
                              console.log('______hover______');
4098c176   Aresn   update Table
15
16
17
18
19
20
21
22
                              return h(etable);
                          },
                          width: 50
                      },
                      {
                          title: '日期',
                          key: 'date',
                          sortable: true
10d3a323   Aresn   fixed #1011
23
                      },
2404849c   leonine   合并原作者更新
24
                      {
7409cb3c   梁灏   fixed #549
25
                          title: '姓名',
4098c176   Aresn   update Table
26
                          key: 'name'
b89a982e   梁灏   fixed #205
27
28
                      },
                      {
7409cb3c   梁灏   fixed #549
29
                          title: '年龄',
10d3a323   Aresn   fixed #1011
30
31
                          key: 'age',
                          sortable: true
99d0429e   梁灏   update Button & T...
32
33
                      },
                      {
7409cb3c   梁灏   fixed #549
34
35
                          title: '地址',
                          key: 'address'
08fd628d   Aresn   Table support expand
36
37
38
                      },
                      {
                          title: '操作',
4098c176   Aresn   update Table
39
                          key: 'name',
08fd628d   Aresn   Table support expand
40
                          render: (h, params) => {
4098c176   Aresn   update Table
41
42
43
44
45
                              return h(test, {
                                  props: {
                                      row: params.row
                                  }
                              });
08fd628d   Aresn   Table support expand
46
                          }
64f99c05   梁灏   Table support ren...
47
48
                      }
                  ],
4098c176   Aresn   update Table
49
                  data5: [
7409cb3c   梁灏   fixed #549
50
51
52
                      {
                          name: '王小明',
                          age: 18,
4098c176   Aresn   update Table
53
54
                          address: '北京市朝阳区芍药居',
                          date: '2016-10-03'
3c38e4f7   梁灏   update Table cell
55
                      },
891f61d8   梁灏   fixed #577
56
                      {
7409cb3c   梁灏   fixed #549
57
58
                          name: '张小刚',
                          age: 25,
e4e8711d   Aresn   Table support dis...
59
                          address: '北京市海淀区西二旗',
4098c176   Aresn   update Table
60
                          date: '2016-10-01'
08fd628d   Aresn   Table support expand
61
62
63
64
                      },
                      {
                          name: '李小红',
                          age: 30,
d6070b23   Aresn   update Table
65
                          address: '上海市浦东新区世纪大道',
4098c176   Aresn   update Table
66
                          date: '2016-10-02'
08fd628d   Aresn   Table support expand
67
68
69
70
                      },
                      {
                          name: '周小伟',
                          age: 26,
4098c176   Aresn   update Table
71
72
73
                          address: '深圳市南山区深南大道',
                          date: '2016-10-04'
                      },
d16dce64   梁灏   fixed #193
74
                  ]
2cb8a6d9   梁灏   commit Table comp...
75
              }
2cb8a6d9   梁灏   commit Table comp...
76
77
          }
      }
d0e206c5   梁灏   Table add content...
78
  </script>