当vue通过span-method合并列之后,出现的合并列显示在中间位置,但是如果页面没有分页,如何进行展示呢,难道要滑到最下面去看吗,下面我们来根据鼠标滑动跟随展示
没有处理的合并页面
<template>
<el-table:data="tableData":span-method="objectSpanMethod"borderstyle="width: 100%; margin-top: 20px"><el-table-columnprop="id"label="ID"width="180"></el-table-column></el-table>
</template>
处理之后的合并页面
<el-table-columnprop="id"label="ID"class-name="ssi-col"width="180"><template slot-scope="props"><div class="ssi-info"><span >{{ scope.row.id }}</span></div></template></el-table-column>
理论上是
给td层加height:1px,给cell加visible之类,给内部span加position:sticky
css样式如下
<style long="scss">
.ssi-col {height: 1px;
.cell {position: relative;height: 100%;overflow: visible;
}.ssi-info{position: sticky;top: 45%;
}
}
结束