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()
        },
相关推荐
光影少年21 分钟前
vite+rust生态链工具链
开发语言·前端·后端·rust·前端框架
skywalk816322 分钟前
当前有什么流行的lisp的web框架吗?
开发语言·前端·lisp
IT_陈寒27 分钟前
为什么我的JavaScript变量老是不听使唤?
前端·人工智能·后端
HookJames30 分钟前
设计Section 06 · Component Sourcing & BOM Risk Control
前端
zhenxin012231 分钟前
HTML头部元信息避坑指南
前端·html
布局呆星43 分钟前
Vite代理解决前端跨域问题 | fetch请求 | 环境变量
前端
sghuter1 小时前
HTML头部元信息避坑指南
c语言·前端·html·cocoa
无心使然云中漫步1 小时前
Openlayers调用ArcGis地图服务之三 —— 要素查询(/query)
前端·arcgis·vue·数据可视化
薛定谔的猫19821 小时前
gradio学习代码部分
java·前端·javascript
yqcoder1 小时前
React 深度解析:类组件 (Class) vs 函数组件 (Function)
前端·javascript·react.js