zoukankan      html  css  js  c++  java
  • element表格鼠标悬浮上带有点击事件的变红-:row-class-name

    element表格鼠标悬浮上带有点击事件的变红

    如图所示

     只需要在el-table标签上加一个:row-class-name

    <el-table
       stripe
       style=" 100%"
       :data="tableData"
       v-loading="isLoading"
       element-loading-text="加载中"
       element-loading-spinner="el-icon-loading"
       element-loading-background="rgba(0, 0, 0, 0.4)"
       :row-class-name="tableRowClassName"
       id="table"
    >
      <el-table-column prop="name" label="考评名称" show-overflow-tooltip :min-width="110">
                 <template slot-scope="scope">
                        <a @click="getMore(scope.row)">{{ scope.row.name }}</a>
                </template>
           </el-table-column>
    </rl-table>

     在methods里写入tableRowClassName//改变当前点击的行的class,高亮当前行

     tableRowClassName(row, index) {
           return "tableBg";
     }

    在css里面写tableBg的样式

    #table.el-table .tableBg td a {
          font-size: 14px;
          color: rgb(61, 34, 31);
        }
        #table.el-table .tableBg:hover td a {
          color: #cc0000;
          border-bottom: 1px solid#cc0000;
          cursor: pointer;
        }
  • 相关阅读:
    P2813 母舰
    P5367 【模板】康托展开
    P1816 忠诚
    P3865 【模板】ST表
    P1913 L国的战斗之伞兵
    P4939 Agent2
    P1894 [USACO4.2]完美的牛栏The Perfect Stall
    P5017 摆渡车
    P1330 封锁阳光大学
    P5018 对称二叉树
  • 原文地址:https://www.cnblogs.com/Jerry1208/p/13329059.html
Copyright © 2011-2022 走看看