之前是再uni-td上面加的click事件,但是并不好用
<uni-table class="uTable" ref="table" :loading="loading" border stripe :type="type" emptyText="暂无更多数据" @selection-change="selectionChange">
<uni-tr>
<uni-th v-for="item in column" :key="`${item.value}${item.label}`" :align="item.align || 'center'" :width="item.width" :class="`px${item.width}`">{{item.label}}</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in dataList" :key="index" :class="clickIndex === index ? 'actived' : ''">
<uni-td v-for="(tableItem, tableIndex) in column" :key="`${tableItem.value}${tableItem.label}`" :align="tableItem.align || 'center'" @click="handleClick(tableItem, item, index)">
</uni-td>
</uni-tr>
</uni-table>
后来改为了在uni-tr上加row-click事件,就可以找到点击事件了,但是会有几百毫秒的延迟
<uni-table class="uTable" ref="table" :loading="loading" border stripe :type="type" emptyText="暂无更多数据" @selection-change="selectionChange">
<uni-tr>
<uni-th v-for="item in column" :key="`${item.value}${item.label}`" :align="item.align || 'center'" :width="item.width" :class="`px${item.width}`">{{item.label}}</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in dataList" :key="index" :class="clickIndex === index ? 'actived' : ''" @row-click="handleClick(tableItem, item, index)">
<uni-td v-for="(tableItem, tableIndex) in column" :key="`${tableItem.value}${tableItem.label}`" :align="tableItem.align || 'center'">
</uni-tr>
</uni-table>