el-popover放在el-table中點擊無反應問題解決方案
我們想在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="請輸入內(nèi)容"
: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去控制關(guān)閉
deltaskList(index){
this.$refs[`popover-${index}`].doClose()
},到此這篇關(guān)于el-popover放在el-table中點擊無反應問題的文章就介紹到這了,更多相關(guān)el-popover el-table內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Javascript中this關(guān)鍵字指向問題的測試與詳解
this是Javascript中一個非常容易理解錯,進而用錯的特性。所以下面這篇文章主要給大家介紹了關(guān)于Javascript中this關(guān)鍵字指向問題的相關(guān)資料,文中通過測試的題目考驗大家對this的熟悉程度,需要的朋友可以參考借鑒,下面來一起看看吧。2017-08-08
CKEditor擴展插件:自動排版功能autoformat插件實現(xiàn)方法詳解
這篇文章主要介紹了CKEditor擴展插件:自動排版功能autoformat插件實現(xiàn)方法,結(jié)合實例形式詳細分析了CKEditor擴展插件實現(xiàn)自動排版功能的autoformat插件具體定義、配置與使用技巧,需要的朋友可以參考下2020-02-02
javascript數(shù)組按屬性分組實現(xiàn)方法
在開發(fā)過程中,前端有時需要對后端返回的數(shù)據(jù)進行一些處理,當后端返回給我們json對象數(shù)組時,我們可能會需要按照對象中的某一個屬性來進行分組,下面這篇文章主要給大家介紹了關(guān)于javascript數(shù)組按屬性分組的實現(xiàn)方法,需要的朋友可以參考下2023-05-05

