太原做网站联系方式中国十大seo
在使用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);},
....