当前位置: 代码网 > it编程>编程语言>Javascript > el-popover放在el-table中点击无反应问题解决方案

el-popover放在el-table中点击无反应问题解决方案

2024年05月26日 Javascript 我要评论
我们想在table中给btn加弹框但是el-popover点击按钮没有任何反应思考:通过插槽去添加这个组件el-popover的id是否绑定了一个值解决思路:给每个el-popover都加上单独的id

我们想在table中给btn加弹框但是 el-popover点击按钮没有任何反应
思考:通过插槽去添加这个组件el-popover的id是否绑定了一个值
解决思路:给每个el-popover都加上单独的id

效果 :

 代码  给每个组件都绑定ref

<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去控制关闭

 deltasklist(index){
            this.$refs[`popover-${index}`].doclose()
        },

到此这篇关于el-popover放在el-table中点击无反应问题的文章就介绍到这了,更多相关el-popover el-table内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com