<el-table></el-table>标签里加一行操作行
<el-table-column
fixed="right"
label="操作"
width="120">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData)"
type="text"
size="small">
移除
</el-button>
</template>
</el-table-column>
方法:
deleteRow(index, rows) {
rows.splice(index, 1);
}
本文介绍了如何在使用ElementUI的<el-table>组件中添加一行操作列,包含一个点击后执行删除功能的按钮。通过`deleteRow`方法实现动态删除指定索引的数据行,展示了Vue.js中DOM操作和数据管理的基本应用。
2708

被折叠的 条评论
为什么被折叠?



