0
点赞
收藏
分享

微信扫一扫

eclipse搭建java web项目

kmoon_b426 2024-03-05 阅读 50

在使用element UI Table组件时,需要点击取当前行索引,并删除当前行,看了element UI 文档好象没有这个的,仔细看下发现当前行索引是在scope里的$.index里。
element UI文档:https://www.uihtm.com/element/#/zh-CN/component/table
代码:

<el-table :data="tableData">
<el-table-column prop="HDBUReportSubCode" label="Product Name" width="180" fixed="left">
            <template slot-scope="scope">
             {{scope.row.name}} <i class="el-icon-delete" @click="delRow(scope.$index)"></i>
            </template>
            </el-table-column>
</el-table>


....
//这样就可以删除行数据
delRow(index)
        {
            this.tableData.splice(index,1);
        },
....
举报

相关推荐

0 条评论