Blame view

examples/routers/table.vue 3.57 KB
2cb8a6d9   梁灏   commit Table comp...
1
  <template>
afea484f   梁灏   fixed #1271
2
3
4
5
6
7
8
      <Table
              width="550"
              border
              highlight-row
              :columns="columns2"
              @on-selection-change="change2"
              :data="data3"></Table>
2cb8a6d9   梁灏   commit Table comp...
9
10
  </template>
  <script>
fcf3cace   梁灏   Poptip & Tooltip ...
11
      import test from '../components/test.vue';
2cb8a6d9   梁灏   commit Table comp...
12
      export default {
2cb8a6d9   梁灏   commit Table comp...
13
14
          data () {
              return {
8b530b1c   梁灏   fixed #1342
15
                  columns2: [
10d3a323   Aresn   fixed #1011
16
                      {
8b530b1c   梁灏   fixed #1342
17
18
19
                          type: 'selection',
                          width: 60,
                          align: 'center'
10d3a323   Aresn   fixed #1011
20
                      },
2404849c   leonine   合并原作者更新
21
                      {
8b530b1c   梁灏   fixed #1342
22
23
24
                          title: '姓名',
                          key: 'name',
                          width: 100,
096f2bfe   梁灏   fixed #1357
25
                          sortable: true,
1b737fdc   梁灏   fixed #122
26
27
28
29
  //                        fixed: 'left',
  //                        renderHeader: (h, params) => {
  //                            return h('Tag', params.index)
  //                        }
b89a982e   梁灏   fixed #205
30
31
                      },
                      {
8b530b1c   梁灏   fixed #1342
32
33
                          title: '年龄',
                          key: 'age',
1b737fdc   梁灏   fixed #122
34
                          sortable: true,
8b530b1c   梁灏   fixed #1342
35
                          width: 100
99d0429e   梁灏   update Button & T...
36
37
                      },
                      {
8b530b1c   梁灏   fixed #1342
38
39
40
41
42
43
44
45
46
47
48
49
50
                          title: '省份',
                          key: 'province',
                          width: 100
                      },
                      {
                          title: '市区',
                          key: 'city',
                          width: 100
                      },
                      {
                          title: '地址',
                          key: 'address',
                          width: 200
08fd628d   Aresn   Table support expand
51
52
                      },
                      {
8b530b1c   梁灏   fixed #1342
53
54
55
56
57
58
59
60
61
62
                          title: '邮编',
                          key: 'zip',
                          width: 100
                      },
                      {
                          title: '操作',
                          key: 'action',
                          fixed: 'right',
                          width: 120,
                          render: (h, params) => {
fcf3cace   梁灏   Poptip & Tooltip ...
63
                              return h(test);
8b530b1c   梁灏   fixed #1342
64
65
66
67
68
                          }
                      }
                  ],
                  data3: [
                      {
7409cb3c   梁灏   fixed #549
69
70
                          name: '王小明',
                          age: 18,
4098c176   Aresn   update Table
71
                          address: '北京市朝阳区芍药居',
8b530b1c   梁灏   fixed #1342
72
73
74
                          province: '北京市',
                          city: '朝阳区',
                          zip: 100000
3c38e4f7   梁灏   update Table cell
75
                      },
891f61d8   梁灏   fixed #577
76
                      {
7409cb3c   梁灏   fixed #549
77
                          name: '张小刚',
8b530b1c   梁灏   fixed #1342
78
                          age: 25,
e4e8711d   Aresn   Table support dis...
79
                          address: '北京市海淀区西二旗',
8b530b1c   梁灏   fixed #1342
80
81
82
                          province: '北京市',
                          city: '海淀区',
                          zip: 100000
08fd628d   Aresn   Table support expand
83
84
85
86
                      },
                      {
                          name: '李小红',
                          age: 30,
d6070b23   Aresn   update Table
87
                          address: '上海市浦东新区世纪大道',
8b530b1c   梁灏   fixed #1342
88
89
90
                          province: '上海市',
                          city: '浦东新区',
                          zip: 100000
08fd628d   Aresn   Table support expand
91
92
93
94
                      },
                      {
                          name: '周小伟',
                          age: 26,
4098c176   Aresn   update Table
95
                          address: '深圳市南山区深南大道',
8b530b1c   梁灏   fixed #1342
96
97
98
                          province: '广东',
                          city: '南山区',
                          zip: 100000
68b308ee   梁灏   fixex #1353
99
                      }
8b530b1c   梁灏   fixed #1342
100
                  ]
2cb8a6d9   梁灏   commit Table comp...
101
              }
b0f1c61f   Rijn   add a event @on-s...
102
          },
8b530b1c   梁灏   fixed #1342
103
104
105
106
107
108
109
110
          methods: {
              change1 (d, l) {
  //                console.log(d)
  //                console.log(l)
              },
              change2 (d, l) {
                  console.log(d);
                  console.log(l);
b0f1c61f   Rijn   add a event @on-s...
111
              }
2cb8a6d9   梁灏   commit Table comp...
112
113
          }
      }
8b530b1c   梁灏   fixed #1342
114
  </script>