鼠标悬浮在表格行上时,符合条件的数据会有提示文字

鼠标悬浮在表格行上时,符合条件的数据会有提示文字
在这里再详细的描述一下文章解决的问题,比如说现在你的页面上有一个表格 el-table ,这个表格有两列,分别是姓名,性别。但是后端传过来的其实是三列(还有一个是分数),可是业务要求是不展示分数。这时当你的鼠标悬浮在表格行上时,如果这个同学的分数是100,那就会在这行上悬浮显示:这个小孩真牛逼!

主要就是用cell-mouse-enter和cell-mouse-leave

下面是图示:
在这里插入图片描述

template

<el-table
:data="invCaseList"
@cell-mouse-enter="caseRowEnter"
@cell-mouse-leave="caseRowLeave"
>
  <el-table-column
  sortable="custom"
  prop="inv_invest_plan_d"
  :label="'拟投入募集资金金额\n(亿元)'" min-width="15%" align="right">
    <template slot-scope="scope">
      <div v-if="scope.row.projectSummary">
        <div v-if="scope.row.investPlan">{{scope.row.investPlan}}</div>
      </div>
      <div v-else>
        <el-popover trigger="hover" placement="top" :ref="'popover' + scope.row.id" >
          <span>提示:该募投项目未披露项目信息,无法查看项目详情</span>
      	  <div slot="reference">
        	<div>{{scope.row.investPlan}}</div>
      	  </div>
      	</el-popover>
      </div>
    </template>
  </el-table-column>
</el-table>

//文章中的projectSummary 就相当于上面所说的分数  investPlan相当于姓名
// 这个提示框你自己选择要放在哪个位置

methods

      caseRowEnter(row){
        if (!row.projectSummary) {
          this.$refs['popover'+row.id].showPopper = true
        }
      },
      caseRowLeave(row){
        this.$refs['popover'+row.id].showPopper = false
      },
  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Rabbityyhh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值