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()
        },
相关推荐
YaHuiLiang1 分钟前
小微互联网公司与互联网创业公司 -- 学历之殇
前端·后端·面试
用户26124583401613 分钟前
vue学习路线(11.watch对比computed)
前端·vue.js
CAD老兵10 分钟前
前端 Source Map 原理与结构详解
前端
gnip13 分钟前
markdown预览自定义扩展实现
前端·javascript
大猫会长25 分钟前
mac中创建 .command 文件,执行node服务
前端·chrome
旧时光_25 分钟前
Zustand 状态管理库完全指南 - 进阶篇
前端·react.js
snakeshe101027 分钟前
深入理解useState:批量更新与非函数参数支持
前端
windliang27 分钟前
Cursor 排查 eslint 问题全过程记录
前端·cursor
boleixiongdi28 分钟前
# Bsin-App Uni:面向未来的跨端开发框架深度解析
前端
G等你下课31 分钟前
AJAX请求跨域问题
前端·javascript·http