el-popover 点击确定或取消的时候隐藏弹窗问题
<template>
<el-popover placement="bottom" width="230" trigger="manual" v-model="visibleList[index]">
<div class="popInfo">
<p>默认值</p>
<el-input v-model="defaultValueInput" placeholder="默认值"></el-input>
<div class="popCheckbox">
<span>查询条件是否显示</span>
<input type="checkbox" />
</div>
<div class="popButton">
<el-button type="primary" @click="closeDefaultPopover(index,'confirm')">确定</el-button>
<el-button @click="closeDefaultPopover(index,'cancel')">取消</el-button>
</div>
</div>
<i class="el-icon-setting" slot="reference" @click="openDefaultPopover(index)"></i>
</el-popover>
</template>
<script>
export default {
data() {
return{
visibleList: [],
}
},
methods: {
closeDefaultPopover(index,type) {
if(type === 'confirm') {
console.log('點擊了確認按鈕');
this.$set(this.visibleList, index, false);
}else if(type === 'cancel') {
console.log('點擊了取消按鈕');
this.$set(this.visibleList, index, false);
}
},
openDefaultPopover(index) {
console.log('打開了彈窗');
this.$set(this.visibleList, index, true);
},
}
}
</script>