Blame view

examples/routers/table.vue 1.87 KB
2cb8a6d9   梁灏   commit Table comp...
1
  <template>
3aca3d56   梁灏   fixed #1372
2
3
4
5
      <div>
          <Table highlight-row :columns="columns3" :data="data1" ref="table" @on-current-change="handleChange"></Table>
          <Button @click="handleClear">clear</Button>
      </div>
2cb8a6d9   梁灏   commit Table comp...
6
7
  </template>
  <script>
2cb8a6d9   梁灏   commit Table comp...
8
      export default {
51356c2c   梁灏   fixed #658
9
10
          data () {
              return {
3aca3d56   梁灏   fixed #1372
11
                  columns3: [
10d3a323   Aresn   fixed #1011
12
                      {
3aca3d56   梁灏   fixed #1372
13
                          type: 'index',
17db7df4   梁灏   fixed #1751
14
15
                          width: 60,
                          align: 'center'
51356c2c   梁灏   fixed #658
16
17
                      },
                      {
8a392d25   梁灏   Table expand supp...
18
19
                          title: '姓名',
                          key: 'name'
51356c2c   梁灏   fixed #658
20
21
                      },
                      {
8a392d25   梁灏   Table expand supp...
22
23
                          title: '年龄',
                          key: 'age'
51356c2c   梁灏   fixed #658
24
                      },
8a392d25   梁灏   Table expand supp...
25
26
27
28
                      {
                          title: '地址',
                          key: 'address'
                      }
51356c2c   梁灏   fixed #658
29
                  ],
17db7df4   梁灏   fixed #1751
30
                  data1: [
835b37ff   梁灏   fixed #1403
31
32
33
                      {
                          name: '王小明',
                          age: 18,
3aca3d56   梁灏   fixed #1372
34
                          address: '北京市朝阳区芍药居'
835b37ff   梁灏   fixed #1403
35
36
37
38
                      },
                      {
                          name: '张小刚',
                          age: 25,
3aca3d56   梁灏   fixed #1372
39
                          address: '北京市海淀区西二旗'
835b37ff   梁灏   fixed #1403
40
                      },
8a392d25   梁灏   Table expand supp...
41
42
43
                      {
                          name: '李小红',
                          age: 30,
3aca3d56   梁灏   fixed #1372
44
                          address: '上海市浦东新区世纪大道'
8a392d25   梁灏   Table expand supp...
45
46
47
48
                      },
                      {
                          name: '周小伟',
                          age: 26,
3aca3d56   梁灏   fixed #1372
49
                          address: '深圳市南山区深南大道'
8a392d25   梁灏   Table expand supp...
50
                      }
8b530b1c   梁灏   fixed #1342
51
                  ]
2cb8a6d9   梁灏   commit Table comp...
52
              }
3aca3d56   梁灏   fixed #1372
53
54
55
56
57
58
59
60
          },
          methods: {
              handleClear () {
                  this.$refs.table.clearCurrentRow();
              },
              handleChange (newData, oldData) {
                  console.log(newData, oldData)
              }
2cb8a6d9   梁灏   commit Table comp...
61
62
          }
      }
17db7df4   梁灏   fixed #1751
63
  </script>