//html部分
<el-table-column v-for="(item,index) in theadData" :prop="item.Field" :label="item.Value" :key="index" :width="tableWidth(item.label)">
</el-table-column>
//js部分
tableWidth(l) {
let width = ''
switch (l) {
case '块长姓名':
width = '100'
break
case '所属居委':
width = '150'
break
case '姓名':
width = '100'
break
case '身份证':
width = '180'
break
default:
width = ''
}
return width
}
el-table-column循环创建表格时设置列宽
最新推荐文章于 2025-04-08 18:20:30 发布