当前位置:   article > 正文

el-popover放在el-table中点击无反应问题

el-popover放在el-table中点击无反应问题

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

效果 :

 代码  给每个组件都绑定ref

  1. <template slot-scope="scope">
  2. <div>
  3. <el-popover
  4. placement="left"
  5. v-else-if="scope.row.cmiBusiApproveInfo"
  6. width="400"
  7. :ref="`popover-${scope.$index}`">
  8. <p>审批意见</p>
  9. <el-input
  10. type="textarea"
  11. placeholder="请输入内容"
  12. :rows="6"
  13. v-model="scope.row.approve"
  14. show-word-limit
  15. >
  16. </el-input>
  17. <div style="text-align: center; margin: 10px">
  18. <el-button size="small" @click="deltaskList(scope.$index)">取消
  19. </el-button>
  20. <el-button size="small" type="danger" @click="confirm(scope.row,'reject',scope.$index)">驳回
  21. </el-button>
  22. <el-button size="small" type="primary" @click="confirm(scope.row,'agree',scope.$index)">确定
  23. </el-button>
  24. </div>
  25. <el-button slot="reference" @click="auditClick(scope.row,scope.$index)" size="mini" >审核</el-button>
  26. </el-popover>
  27. </div>
  28. </template>

 通过他的id去控制关闭

  1. deltaskList(index){
  2. this.$refs[`popover-${index}`].doClose()
  3. },

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/501112
推荐阅读
相关标签
  

闽ICP备14008679号