<template<el-button size="mini" type="text">分配权限</el-button><el-button size="mini" type="text" @click="btnEditRow(row)">编辑</el-button ><el-popconfirmtitle="这是一段内容确定删除吗?"@onConfirm="confirmDel(row.id)"><el-buttonslot="reference"style="margin-left: 10px"size="mini"type="text">删除</el-button></el-popconfirm></template> export default {data() {return {pageParams: {pagesize: 5, //每页多少条page: 1, //当前页码数total: 0,},}methods:{//把具体的要删的某条数据传递进来。async confirmDel(id) {//调删除接口await delRole(id);this.$message.warning("删除成功");//如果列表的长度为1 ,就让页码自减if (this.list.length === 1) {this.pageParams.page--;}//再删除成功后调用数据接口,刷新页面this.getRoleList();},} }