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()
        },
相关推荐
梦650几秒前
【前端实战】图片元素精准定位:无论缩放,元素始终钉在指定位置
前端·html·css3
计算机学姐14 分钟前
基于SpringBoot的美妆销售系统【个性化推荐算法+数据可视化统计+库存预警+物流信息】
java·vue.js·spring boot·后端·mysql·信息可视化·mybatis
烟袅19 分钟前
一文搞懂 useRef:它到底在“存”什么?
前端·react.js
Knight_AL23 分钟前
Vue + Spring Boot 项目统一添加 `/wvp` 访问前缀实践
前端·vue.js·spring boot
前端er小芳31 分钟前
前端虚拟列表滚动功能实现与核心知识点详解
前端
wuhen_n31 分钟前
Promise状态机与状态流转
前端
3秒一个大31 分钟前
React 中的 useMemo 与 useCallback:性能优化的利器
前端·react.js
cj814032 分钟前
Node.js基本概念理解
前端·node.js
ohyeah33 分钟前
React 缓存三剑客:useMemo、useCallback 与 memo 的正确打开方式
前端·react.js
程序员爱钓鱼35 分钟前
Node.js 编程实战:JWT身份验证与权限管理
前端·后端·node.js