Blame view

examples/routers/table.vue 8.47 KB
2cb8a6d9   梁灏   commit Table comp...
1
  <template>
bb49347b   梁灏   fixed #2823
2
      <div>
1acabf79   梁灏   Table support mul...
3
4
5
6
7
          <br><br><br><br><br>
          <Table border :columns="columns1" height="500" :data="data1"></Table>
          <br><br><br><br><br>
          <!--<Table width="550" height="200" border :columns="columns2" :data="data4"></Table>-->
          <br><br><br><br><br>
bb49347b   梁灏   fixed #2823
8
      </div>
2cb8a6d9   梁灏   commit Table comp...
9
10
  </template>
  <script>
2cb8a6d9   梁灏   commit Table comp...
11
      export default {
51356c2c   梁灏   fixed #658
12
13
          data () {
              return {
1acabf79   梁灏   Table support mul...
14
                  columns1: [
437b8059   Sergio Crisostomo   Added Table to CS...
15
                      {
55f90d87   梁灏   fixed #1648
16
                          title: 'Name',
14d1de05   huanghong   fix table changin...
17
                          key: 'name',
1acabf79   梁灏   Table support mul...
18
19
20
                          align: 'center',
                          width: 200,
                          fixed: 'left'
14d1de05   huanghong   fix table changin...
21
22
                      },
                      {
1acabf79   梁灏   Table support mul...
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
                          title: 'Other',
                          align: 'center',
                          children: [
                              {
                                  title: 'Age',
                                  key: 'age',
                                  align: 'center',
                                  width: 200
                              },
                              {
                                  title: 'Address',
                                  align: 'center',
                                  children: [
                                      {
                                          title: 'Street',
                                          key: 'street',
                                          align: 'center',
                                          width: 200
                                      },
                                      {
                                          title: 'Block',
                                          align: 'center',
                                          children: [
                                              {
                                                  title: 'Building',
                                                  key: 'building',
                                                  align: 'center',
                                                  width: 200
                                              },
                                              {
                                                  title: 'Door No.',
                                                  key: 'door',
                                                  align: 'center',
                                                  width: 200
                                              }
                                          ]
                                      }
                                  ]
                              }
                          ]
                      },
                      {
                          title: 'Company',
                          align: 'center',
                          children: [
                              {
                                  title: 'Company Address',
                                  key: 'caddress',
                                  align: 'center',
                                  width: 200
                              },
                              {
                                  title: 'Company Name',
                                  key: 'cname',
                                  align: 'center',
                                  width: 200
                              }
                          ]
                      },
                      {
                          title: 'Gender',
                          key: 'gender',
                          align: 'center',
                          width: 200,
                          fixed: 'right'
437b8059   Sergio Crisostomo   Added Table to CS...
88
89
                      }
                  ],
9fea8e7d   huanghong   fixed ivu-table-f...
90
91
92
93
94
95
96
97
98
99
                  columns2: [
                      {
                          title: 'Name',
                          key: 'name',
                          width: 100,
                          fixed: 'left'
                      },
                      {
                          title: 'Age',
                          key: 'age',
1acabf79   梁灏   Table support mul...
100
101
102
                          width: 100,
                          fixed: 'right',
                          sortable: true
9fea8e7d   huanghong   fixed ivu-table-f...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
                      },
                      {
                          title: 'Province',
                          key: 'province',
                          width: 100
                      },
                      {
                          title: 'City',
                          key: 'city',
                          width: 100
                      },
                      {
                          title: 'Address',
                          key: 'address',
                          width: 200
                      },
                      {
                          title: 'Postcode',
                          key: 'zip',
1acabf79   梁灏   Table support mul...
122
                          width: 100
9fea8e7d   huanghong   fixed ivu-table-f...
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
                      },
                      {
                          title: 'Action',
                          key: 'action',
                          fixed: 'right',
                          width: 120,
                          render: (h, params) => {
                              return h('div', [
                                  h('Button', {
                                      props: {
                                          type: 'text',
                                          size: 'small'
                                      }
                                  }, 'View'),
                                  h('Button', {
                                      props: {
                                          type: 'text',
                                          size: 'small'
                                      }
                                  }, 'Edit')
                              ]);
                          }
                      }
                  ],
1acabf79   梁灏   Table support mul...
147
148
                  data1: [],
                  data4: [
9fea8e7d   huanghong   fixed ivu-table-f...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
                      {
                          name: 'John Brown',
                          age: 18,
                          address: 'New York No. 1 Lake Park',
                          province: 'America',
                          city: 'New York',
                          zip: 100000
                      },
                      {
                          name: 'Jim Green',
                          age: 24,
                          address: 'Washington, D.C. No. 1 Lake Park',
                          province: 'America',
                          city: 'Washington, D.C.',
                          zip: 100000
                      },
                      {
                          name: 'Joe Black',
                          age: 30,
                          address: 'Sydney No. 1 Lake Park',
                          province: 'Australian',
                          city: 'Sydney',
                          zip: 100000
                      },
                      {
                          name: 'Jon Snow',
                          age: 26,
                          address: 'Ottawa No. 2 Lake Park',
                          province: 'Canada',
                          city: 'Ottawa',
                          zip: 100000
e25070eb   huanghong   fixed #2871
180
181
                      },
                      {
e25070eb   huanghong   fixed #2871
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
                          name: 'John Brown',
                          age: 18,
                          address: 'New York No. 1 Lake Park',
                          province: 'America',
                          city: 'New York',
                          zip: 100000
                      },
                      {
                          name: 'Jim Green',
                          age: 24,
                          address: 'Washington, D.C. No. 1 Lake Park',
                          province: 'America',
                          city: 'Washington, D.C.',
                          zip: 100000
                      },
                      {
                          name: 'Joe Black',
                          age: 30,
                          address: 'Sydney No. 1 Lake Park',
                          province: 'Australian',
                          city: 'Sydney',
                          zip: 100000
                      },
                      {
                          name: 'Jon Snow',
                          age: 26,
                          address: 'Ottawa No. 2 Lake Park',
                          province: 'Canada',
                          city: 'Ottawa',
                          zip: 100000
9fea8e7d   huanghong   fixed ivu-table-f...
212
                      }
bb49347b   梁灏   fixed #2823
213
214
215
                  ]
              }
          },
1acabf79   梁灏   Table support mul...
216
217
218
219
220
221
222
223
224
225
226
227
228
229
          mounted () {
              const data = [];
              for (let i = 0; i < 100; i++) {
                  data.push({
                      key: i,
                      name: 'John Brown',
                      age: i + 1,
                      street: 'Lake Park',
                      building: 'C',
                      door: 2035,
                      caddress: 'Lake Street 42',
                      cname: 'SoftLake Co',
                      gender: 'M',
                  });
c5beedf8   梁灏   fixed #690
230
              }
1acabf79   梁灏   Table support mul...
231
              this.data1 = data;
2cb8a6d9   梁灏   commit Table comp...
232
          }
6c634aa6   梁灏   fixed #2078
233
      }
4ad72493   梁灏   Revert Table demo
234
  </script>