vue通过span-method合并列之后,合并列显示在中间位置,根据鼠标滑动跟随展示

当vue通过span-method合并列之后,出现的合并列显示在中间位置,但是如果页面没有分页,如何进行展示呢,难道要滑到最下面去看吗,下面我们来根据鼠标滑动跟随展示
没有处理的合并页面

<template>
<el-table
      :data="tableData"
      :span-method="objectSpanMethod"
      border
      style="width: 100%; margin-top: 20px">
      <el-table-column
        prop="id"
        label="ID"
        width="180">
        </el-table-column>
           </el-table>
</template>

处理之后的合并页面

 <el-table-column
        prop="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%;
}
}

结束

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值