el-table

作者: 丿Sorry丶 | 来源:发表于2020-04-27 10:17 被阅读0次

    fixed错位问题

    image.png

    fixed之前的el-table-column加个宽度就解决了,width或者min-width都可以


    查找element-ui中el-table组件的行数

    <el-table :data="roleData" border stripe
                          highlight-current-row  :height="autoHeightRow" :row-class-name="rowClassName"  @row-click=‘handleRowClickRole‘ ref="RoleTable">
                  <el-table-column type="index" label="序号" width="55"> </el-table-column>
                  <el-table-column prop="RuleName" label="规则名称" width="180"> </el-table-column>
    </el-table>
    
    rowClassName({row, rowIndex}) {
            //把每一行的索引放进row
            row.index = rowIndex;
         console.log(row)
          }
    

    一般情况下‘row-click‘方法只能获取该行数据,为了能获取到该行的行数index,用row-class-name给每一行都加上index,即可获取index

    相关文章

      网友评论

        本文标题:el-table

        本文链接:https://www.haomeiwen.com/subject/pbaewhtx.html