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()
        },
相关推荐
咖啡の猫41 分钟前
Vue基本路由
前端·vue.js·状态模式
青衫码上行43 分钟前
【Java Web学习 | 第七篇】JavaScript(1) 基础知识1
java·开发语言·前端·javascript·学习
咖啡の猫44 分钟前
Vue编程式路由导航
前端·javascript·vue.js
夏鹏今天学习了吗5 小时前
【性能优化】前端高性能优化策略
前端·性能优化
weixin_427771618 小时前
css font-size 的妙用
前端·css
凤凰战士芭比Q9 小时前
web中间件——Nginx
前端·nginx·中间件
一 乐9 小时前
点餐|智能点餐系统|基于java+ Springboot的动端的点餐系统小程序(源码+数据库+文档)
java·前端·数据库·vue.js·spring boot·小程序·论文
视图猿人10 小时前
RxJS基本使用及在next.js中使用的例子
开发语言·javascript
bitbitDown10 小时前
从零打造一个 Vite 脚手架工具:比你想象的简单多了
前端·javascript·面试
liangshanbo121511 小时前
CSS 数学函数完全指南:从基础计算到高级动画
前端·css