使用el-table的固定列后,出现固定列与表格中间部分断裂的空白样式问题:
仔细检查代码后,发现列的宽度是固定的,把列的宽度设置成最小宽度就可以了
1 <el-table-column label="操作"fixed="right" width="150" align="center" class-name="small-padding fixed-width"> 2 <template slot-scope="scope"> 3 <el-button 4 size="mini" 5 type="text" 6 icon="el-icon-edit" 7 @click="handleEdit(scope.row)" 8 v-hasPerm="['product_edit']" 9 >修改 10 </el-button> 11 <el-button 12 size="mini" 13 type="text" 14 icon="el-icon-view" 15 @click="setDetailData(scope.row)" 16 v-hasPerm="['product_detail']" 17 >详情 18 </el-button> 19 </template> 20 </el-table-column>
更改后的代码是这样的:
最后,问题解决