码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-07-23 14:39:18      阅读:2965      评论:0      收藏:0      [点我收藏+]

标签:方法   strip   dex   rop   type   情况   规则   index   code   

<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

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

标签:方法   strip   dex   rop   type   情况   规则   index   code   

原文地址:https://www.cnblogs.com/fujijill/p/9353859.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!