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()
        },
相关推荐
confiself6 分钟前
deer-flow前端分析
前端
刘宇琪7 分钟前
Vite 生产环境代码分割与懒加载优化
前端
叫我一声阿雷吧7 分钟前
JS 入门通关手册(20):构造函数与原型:JS 面向对象第一课
开发语言·javascript·前端开发·前端面试·构造函数·js进阶·js面向对象
早點睡39013 分钟前
ReactNative项目Openharmony三方库集成实战:@react-native-ohos/react-native-image-picker
javascript·react native·react.js
恋猫de小郭19 分钟前
让你的 OpenClaw 带你学习,清华开源 AI 私人导师 OpenMAIC
前端·人工智能·ai编程
六元七角八分26 分钟前
学习笔记二《JavaScript 流程控制》
javascript·笔记
石小石Orz28 分钟前
AI焦虑下,前端该何去何从
前端
用户4055948025029 分钟前
对组件内使用:deep()修改自身样式和样式穿透的记录
vue.js
何中应30 分钟前
<el-tree>标签问题
前端·vue.js·elementui
坚持学习前端日记30 分钟前
ComfyUI模型管理与集成方案
前端·人工智能·python