Blame view

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