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()
        },
相关推荐
IT_陈寒27 分钟前
Redis误用keys命令把生产环境搞崩了,血的教训
前端·人工智能·后端
计算机魔术师39 分钟前
5000亿估值冲刺科创板,DeepSeek 为何急着上市?
前端
我血条子呢44 分钟前
前端解析word方案
前端·word
kyriewen1 小时前
我用 AI 写完一个需求后才发现,最难的不是 prompt,而是验收
前端·程序员·ai编程
申行1 小时前
Vue 3 + DYMO Connect Framework 实战:从标签模板到打印服务的完整实现
前端
两只羊ovo1 小时前
Vue 3 + DeepSeek 流式输出实战:从“干等”到“打字机”体验
前端·vue.js
Yeyu1 小时前
车载多 App 同屏渲染(二):SurfaceControlViewHost 跨进程
前端
樊小肆1 小时前
离谱,每轮请求 25% 的 token,竟在重发模型想完就扔的内心独白
前端·人工智能·agent
小妖现世1 小时前
前端面试复习笔记:React 高频题 + JS 手写题
前端
holidaypenguin1 小时前
Windows 本地 HTTPS 证书生成指南
前端