背景:
每个宝贝会有是否禁用标识,如果禁用,则不能禁止勾选,鼠标划过此宝贝时会悬浮提示文案。
简单的做法是在宝贝标题上用title去判断展示文案,比如
<p :title="!scope.row.accessAllowed?scope.row.reason: ''">{
{ scope.row.title }}</p>
但是产品不同意,觉得这样不够醒目!!!要求在鼠标经过此行时就出现提示文案。哎。写吧。
效果:
实现方案:
在table上绑定事件
<el-table :data="tableData"
:max-height="tableHeight" style="width:100%"
v-loading="loading"
highlight-current-row
@cell-mouse-enter="handleMouseEnter"
@cell-mouse-leave="handleMouseLeave"
@sort-change="sortChange"></el-table>
js写法:
handleMouseEnter(row, colu