在table中加上两行代码,可以i自定义行和列的高度和内边距
:row-style="{height: '0'}" :cell-style="{padding: '2px'}"
其中 tableTitle.titleList是arr中的每一个对像的键,把每一个对象键当作表头,把键值当作内容
<Table
:data="arr"
size="small"
border
v-if="(arr.length)"
style="width: 100%"
min-height="200px"
max-height="390px"
:row-style="{height: '0'}"
:cell-style="{padding: '2px'}">
<TableColumn v-for="(item,index) in tableTitle.titleList" :key="item.id" align="left" prop="scope" style="position: relative ;" min-width="105" >
<template slot="header" slot-scope="scope">
<div class="rds-header"> {{item}}</div>
</template>
<template slot-scope="scope">
<div class="rds-show">
<div class="rds-show-copy" @click.stop="copyText(scope.row,item)">复制</div>
{{scope.row[item]}}
</div>
</template>
</TableColumn>
</Table>