当前位置: 首页 > news >正文

【elementui】el-popover在列表里循环使用,取消的doClose无效解决办法

目录

    • 一、需求效果
    • 二、代码详情
      • html
      • 方法
      • 接口

一、需求效果

在使用elementui的Popover 弹出框时,需求是在table列表里使用,循环出来,无法取消。
在这里插入图片描述
在这里插入图片描述

二、代码详情

html

 <el-table-column v-if="checkPermission(['admin','user:resetPass','user:edit','user:del'])" label="操作" width="200" align="center" fixed="right"><template slot-scope="scope"><el-popoverv-permission="['admin','user:resetPass']":ref="scope.row.id"placement="top"width="180"><p>确定重置密码吗?</p><div style="text-align: right; margin: 0"><el-button size="mini" type="text" @click="handleClick()">取消</el-button><el-button type="primary" size="mini" @click="subResetPass(scope.row)">确定</el-button></div><el-button slot="reference" type="primary" icon="el-icon-key" size="mini"/></el-popover><el-button v-permission="['admin','user:edit']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/><el-popoverv-permission="['admin','user:del']":ref="scope.row.id"placement="top"width="180"><p>确定删除本条数据吗?</p><div style="text-align: right; margin: 0"><el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button><el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button></div><el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/></el-popover></template></el-table-column>

方法

    handleClick(val) {document.body.click()},
    subResetPass(row) {const params = { userId: row.id }resetPass(params).then(res => {this.$notify({title: '重置成功',message: '默认密码:123456',type: 'success',duration: 2500})document.body.click()}).catch(err => {document.body.click()console.log(err.response.data.message)})},

接口

export function resetPass(params) {return request({url: 'stbiapi/api/users/resetPass',method: 'get',params})
}

参考文章:el-popover在列表里循环使用,关闭不了???
el-popover 使用 doClose() 关闭窗口不生效
[Vue] element表格中使用el-popover弹窗编辑内容保存和取消的doClose无效解决办法

http://www.lryc.cn/news/241241.html

相关文章:

  • 【php】解决加载速度慢导出超时问题记录
  • postgresql安装fdw扩展
  • 反爬虫机制与反爬虫技术(二)
  • Grails 启动
  • 2023年亚太地区数学建模大赛 问题A
  • 基于springboot实现校园在线拍卖系统项目【项目源码】
  • 详解ES6的Promise
  • 多语言快速排序算法
  • opencv-图像梯度
  • linux centos7 安装nginx
  • Xilinx Zynq-7000系列FPGA实现视频拼接显示,提供两套工程源码和技术支持
  • DAOS低时延与高性能RDMA网络
  • 城市管理实景三维:打造智慧城市的新引擎
  • Python3.11+Pyside6开发电影下载程序
  • HCIP-七、IS-IS 综合实验
  • 广西桂林钢结构钣金折弯件3d扫描全尺寸偏差检测-CASAIM中科广电
  • 飞翔的小鸟游戏
  • 计算机网络之运输层
  • 2023软件应用类下载系统平台源码/手机软件应用、新闻资讯下载站/软件库网站源码
  • SkyWalking配置报警推送到企业微信
  • educoder中Hive -- 索引和动态分区调整
  • http与https有什么区别,https攻击要如何防护
  • nginx+keepalived
  • Re51:读论文 Language Models as Knowledge Bases?
  • .NET 使用配置文件
  • vue 通过ref调用router-view子组件的方法
  • 在全球碳市场中崭露头角的中碳CCNG
  • uni-app - 弹出框
  • 深度学习之基于Tensorflow卷积神经网络鸟类目标识别检测系统
  • 关闭EntityFramework日志输出SQL