Skip to content

Commit f94dad5

Browse files
author
283591387@qq.com
committed
修复移动端vol-table不能同时使用多个组件的问题
1 parent 5509ff8 commit f94dad5

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

vol.uniapp/components/vol-table/vol-table.vue

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,11 @@
7979
{{rowFormatterValue(row,column)}}
8080
</view>
8181
<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>
8887
</view>
8988
<view v-else-if="column.type=='date'">
9089
{{(row[column.field]||'').substr(0,10)}}
@@ -95,8 +94,9 @@
9594
</view>
9695
<view style="margin:20rpx 0 40rpx 20rpx" @click.stop>
9796
<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">
100100
</u-button>
101101
</view>
102102
</view>
@@ -109,9 +109,8 @@
109109
</template>
110110

111111
<script>
112-
let _this;
113112
export default {
114-
// name: "vol-table",
113+
name: "vol-table",
115114
props: {
116115
loadKey: {
117116
type: Boolean,
@@ -218,11 +217,11 @@
218217
this.rowClick(index, this.rowsData[index], columns);
219218
return;
220219
}
221-
_this.$emit('rowClick', index, this.rowsData[index], columns);
220+
this.$emit('rowClick', index, this.rowsData[index], columns);
222221
},
223222
rowFormatter(row, column, index) {
224223
let _val;
225-
_this.$emit('formatter', row, column, index, (val) => {
224+
this.$emit('formatter', row, column, index, (val) => {
226225
_val = val;
227226
})
228227
return _val;
@@ -327,19 +326,18 @@
327326
},
328327
rowButtons(index, row) {
329328
let _buttons = [];
330-
this.$emit('rowButtons',index, row, (buttons) => {
329+
this.$emit('rowButtons', index, row, (buttons) => {
331330
_buttons = buttons;
332331
})
333332
console.log(_buttons)
334-
return (_buttons || [])//.reverse();
333+
return (_buttons || []) //.reverse();
335334
},
336335
rowBtnClick(btn, rowindex, row) {
337336
this.$emit('rowButtonClick', btn, rowindex, row);
338337
}
339338
},
340339
created() {
341340
this.getData();
342-
_this = this;
343341
this.inColumns = this.columns;
344342
if (this.loadKey) {
345343
this.loadSource();

0 commit comments

Comments
 (0)