In the previous article , use @row-click
to get the data of the currently clicked record, and then call the delete method
In fact, the "Delete" button is wrapped in a template. You can use the scope to get the data of the currently selected row, and you don't need @row-click
to assist to get the data of the selected row. The code at that time is as follows:
<el-table-column prop="" label="操作">
<template>
<div class="flex-c-a">
<span class="delete-btn">删除</span>
</div>
</template>
</el-table-column>
If you directly use scope to get the current row record, you can do this:
html:
<el-table-column prop="" label="操作" align="center">
<template>
<div class="flex-c-a">
<span class="delete-btn" @click="removeFundBtn(scope.row)">删除</span>
</div>
</template>
</el-table-column>
The deleted method is still the same, and the effect is the same