美文网首页
el-table拿到当前行索引

el-table拿到当前行索引

作者: 小白的踩坑日常 | 来源:发表于2020-05-13 11:19 被阅读0次
image.png

代码:

        <template slot-scope="scope" >
          <el-tooltip class="item" effect="dark" content="删除当前行" placement="top" :enterable="false">
              <el-button type="danger" icon="el-icon-delete" size="mini" circle @click="delRow(scope.$index)"></el-button>
          </el-tooltip>
        </template>
      </el-table-column>
image.png

这样就拿到了,超简单!scope上有$index这个属性的

相关文章

网友评论

      本文标题:el-table拿到当前行索引

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