- 行删除
<el-table-column
fixed="right"
label="操作"
width="120">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData4)"
type="text"
size="small">
移除
</el-button>
</template>
</el-table-column>
<script>
export default {
methods: {
deleteRow(index, rows) {
rows.splice(index, 1);
}
}
}
</script>
本文介绍如何在Vue.js项目中使用Element UI组件库实现表格数据行的删除功能。通过<el-table>组件展示数据,并利用自定义槽位(slot-scope)结合@click事件实现行移除操作。代码示例详细展示了方法的具体实现。
1174

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



