今天敲代码遇到了一个bug
自己原先的代码:
<el-table-column align="right"> <el-button type="primary" plain style="width: 50px; font-size: 13px" >修改</el-button > <el-popconfirm confirmButtonText="好的" cancelButtonText="不用了" icon="el-icon-info" iconColor="red" @confirm="deleteStudent(scope.row.id)" title="这是一段内容确定删除吗?"> <template #reference> <el-button type="danger">删除</el-button> </template> </el-popconfirm> <!-- </template><template v-slot="scope"></template> --> </el-table-column>
改好的代码:
<el-table-column align="right"> <template v-slot="scope"><el-button type="primary" plain style="width: 50px; font-size: 13px" >修改</el-button > <el-popconfirm confirmButtonText="好的" cancelButtonText="不用了" icon="el-icon-info" iconColor="red" @confirm="deleteStudent(scope.row.id)" title="这是一段内容确定删除吗?"> <template #reference> <el-button type="danger">删除</el-button> </template> </el-popconfirm> </template>
<template v-slot="scope">将template的标签改成这样