<el-table ref="tableRef" row-key="num" :data="fileListss" style="width: 100%;"> <el-table-column type="expand"> <el-table-column min-width="25%" prop="num" label="操作"> <template #default="scope"> <el-button type="primary" plain @click="edit(scope.row), bianji = true, upload_btn = true">编辑</el-button> <el-button type="danger" plain @click="delets(scope.row.id), centerDialogVisible = true">删除</el-button> </template> </el-table-column> </el-table>
:data是给此表格绑定数据
然后 <template #default="scope"></>是获取当前行的数据,这样就可以给他添加点击的时候进行精确传参了