当前位置: 首页> 房产> 政策 > 南宁在线制作网站_公众号公众平台_优化防控措施_朋友圈广告

南宁在线制作网站_公众号公众平台_优化防控措施_朋友圈广告

时间:2025/7/10 9:05:24来源:https://blog.csdn.net/lyj168997/article/details/144775577 浏览次数:0次
南宁在线制作网站_公众号公众平台_优化防控措施_朋友圈广告

多级表头固定列

代码示例-不能直接运行,仅供参考

<el-table ref="table" class="table":data="list"style="width: 100%":header-cell-style="headerCellStyle"v-loading="dataLoading":span-method="spanMethod"><el-table-column v-for="(item, index) in tableHeader" :label="item.name" :key="index" :fixed="item.fixed":min-width="item.width"><el-table-column v-for="(head,j) in item.header" :label="head.label" :key="j+'ii'":fixed="head.fixed":prop="head.id":min-width="head.minW":class-name="setClass(head.id)"></el-table-column></el-table-column>
</el-table>需要在修改样式-避免固定列数据空白情况
<style lang="less" scoped>
.table {/deep/.el-table__cell.is-hidden>*{//多级表头固定列-样式修改visibility: visible;}
}
</style>

合并单元格

如图,下列方法实现的是图中的合并单元格的方式方法

function spanMethod({ row, column, rowIndex, columnIndex }) {let arr = [0, 1, 2, 4, 12, 13, 14, 15, 16, 17,18,19,20,21];//需要合并的列let spArr = [5, 22, 23, 24, 25, 26, 27];//需要合并的列if (arr.indexOf(columnIndex)>-1) {if (row.rowspan) {return {rowspan: row.rowspan,//合并多少行数据colspan: 1};} else {return {rowspan: 0,colspan: 0};}}else if (spArr.indexOf(columnIndex) > -1) {if (row.spRowspan) {return {rowspan: row.spRowspan,colspan: 1};} else {if (!row.mcId) {//避免不合并的行,缺少数据,导致没有边框return {rowspan: 1,colspan: 1}; } else {return {rowspan: 0,colspan: 0}; }}}},

关键字:南宁在线制作网站_公众号公众平台_优化防控措施_朋友圈广告

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: