|
79 | 79 | {{rowFormatterValue(row,column)}} |
80 | 80 | </view> |
81 | 81 | <view v-else-if="column.type=='img'"> |
82 | | - <view style="float: right;margin-left:10px;" width="50px" height="50px" v-for="(src,index) in getImgSrc(row[column.field])"> |
83 | | - <u--image |
84 | | - width="50px" height="50px" |
85 | | - radius="4px" :src="src" |
86 | | - :key="index"></u--image> |
87 | | - </view> |
| 82 | + <view style="float: right;margin-left:10px;" width="50px" height="50px" |
| 83 | + v-for="(src,index) in getImgSrc(row[column.field])"> |
| 84 | + <u--image width="50px" height="50px" radius="4px" :src="src" :key="index"> |
| 85 | + </u--image> |
| 86 | + </view> |
88 | 87 | </view> |
89 | 88 | <view v-else-if="column.type=='date'"> |
90 | 89 | {{(row[column.field]||'').substr(0,10)}} |
|
95 | 94 | </view> |
96 | 95 | <view style="margin:20rpx 0 40rpx 20rpx" @click.stop> |
97 | 96 | <view :key="btnIndex" class="extent-button" v-for="(btn,btnIndex) in rowButtons(rowindex,row)"> |
98 | | - <u-button :icon="btn.icon" :hairline="true" :shape="btn.shape" :disabled="btn.disabled" :plain="btn.plain" :type="btn.type" |
99 | | - style="height:60rpx;" @click="rowBtnClick(btn,rowindex,row)" :text="btn.text"> |
| 97 | + <u-button :icon="btn.icon" :hairline="true" :shape="btn.shape" :disabled="btn.disabled" |
| 98 | + :plain="btn.plain" :type="btn.type" style="height:60rpx;" |
| 99 | + @click="rowBtnClick(btn,rowindex,row)" :text="btn.text"> |
100 | 100 | </u-button> |
101 | 101 | </view> |
102 | 102 | </view> |
|
109 | 109 | </template> |
110 | 110 |
|
111 | 111 | <script> |
112 | | - let _this; |
113 | 112 | export default { |
114 | | - // name: "vol-table", |
| 113 | + name: "vol-table", |
115 | 114 | props: { |
116 | 115 | loadKey: { |
117 | 116 | type: Boolean, |
|
218 | 217 | this.rowClick(index, this.rowsData[index], columns); |
219 | 218 | return; |
220 | 219 | } |
221 | | - _this.$emit('rowClick', index, this.rowsData[index], columns); |
| 220 | + this.$emit('rowClick', index, this.rowsData[index], columns); |
222 | 221 | }, |
223 | 222 | rowFormatter(row, column, index) { |
224 | 223 | let _val; |
225 | | - _this.$emit('formatter', row, column, index, (val) => { |
| 224 | + this.$emit('formatter', row, column, index, (val) => { |
226 | 225 | _val = val; |
227 | 226 | }) |
228 | 227 | return _val; |
|
327 | 326 | }, |
328 | 327 | rowButtons(index, row) { |
329 | 328 | let _buttons = []; |
330 | | - this.$emit('rowButtons',index, row, (buttons) => { |
| 329 | + this.$emit('rowButtons', index, row, (buttons) => { |
331 | 330 | _buttons = buttons; |
332 | 331 | }) |
333 | 332 | console.log(_buttons) |
334 | | - return (_buttons || [])//.reverse(); |
| 333 | + return (_buttons || []) //.reverse(); |
335 | 334 | }, |
336 | 335 | rowBtnClick(btn, rowindex, row) { |
337 | 336 | this.$emit('rowButtonClick', btn, rowindex, row); |
338 | 337 | } |
339 | 338 | }, |
340 | 339 | created() { |
341 | 340 | this.getData(); |
342 | | - _this = this; |
343 | 341 | this.inColumns = this.columns; |
344 | 342 | if (this.loadKey) { |
345 | 343 | this.loadSource(); |
|
0 commit comments