el-popover放在el-table中点击无反应问题

我们想在table中给btn加弹框但是 el-popover点击按钮没有任何反应
思考 :通过插槽去添加这个组件el-popover的id是否绑定了一个值
解决思路 :给每个el-popover都加上单独的id

效果 :

代码 给每个组件都绑定ref

html 复制代码
<template slot-scope="scope">
                                <div>
                                    <el-popover
                                        placement="left"
                                        v-else-if="scope.row.cmiBusiApproveInfo" 
                                        width="400"
                                        :ref="`popover-${scope.$index}`">
                                        <p>审批意见</p>
                                        <el-input
                                            type="textarea"
                                            placeholder="请输入内容"
                                            :rows="6"
                                            v-model="scope.row.approve"
                                            show-word-limit
                                            >
                                        </el-input>
                                        <div style="text-align: center; margin: 10px">
                                                <el-button size="small"  @click="deltaskList(scope.$index)">取消
                                                </el-button>
                                                <el-button size="small"  type="danger"  @click="confirm(scope.row,'reject',scope.$index)">驳回
                                                </el-button>
                                                <el-button size="small" type="primary" @click="confirm(scope.row,'agree',scope.$index)">确定
                                                </el-button>
                                        </div>

                                        <el-button slot="reference"  @click="auditClick(scope.row,scope.$index)" size="mini" >审核</el-button>
                                    </el-popover>

   
                                </div>
                            </template>

通过他的id去控制关闭

javascript 复制代码
 deltaskList(index){
            this.$refs[`popover-${index}`].doClose()
        },
相关推荐
mONESY几秒前
React 前端如何不傻等后端接口?
前端·javascript·后端
xiaominlaopodaren几秒前
three.js地图数学基础(七):地图相机
javascript·gis·three.js
岁月留痕168几秒前
6 Flutter 篇:Flutter 分层式架构设计
前端
乘风gg2 分钟前
AI Coding:从单兵提效到多 Agent 的团队全链路协作模式
前端·ai编程·claude
万维易源3 分钟前
免费药品信息查询:用API 读懂常用药
java·前端·数据库·药品信息·药品查询·药品查询api
勾勾圈圈蛋蛋8 分钟前
Vue2 与 Vue3 响应式数据原理详解
前端
用户69371750013849 分钟前
深夜炸场!DeepSeek 没发新模型,却重构了整个 Agent 生态
前端·后端·github
岁月留痕16810 分钟前
16 实战项目一:实现暗黑模式
前端
岁月留痕16810 分钟前
7 Flutter 篇:玩转组件(一)
前端
码农阿豪12 分钟前
Ubuntu部署GodoOS:Docker搭建Web办公桌面并实现远程访问
前端·ubuntu·docker