fix: popper trigger is click use v-model bugs

pull/22224/head
jetbn 2022-10-31 17:38:16 +08:00
parent 473ef53f93
commit 535e7ca4a8
2 changed files with 12 additions and 1 deletions

View File

@ -77,6 +77,14 @@ export default {
}
},
watch: {
value: {
immediate: true,
handler(val) {
if (val) {
this.$nextTick(()=> off(this.referenceElement, 'click', this.doToggle));
}
}
},
showPopper(val) {
if (this.disabled) {
return;
@ -92,6 +100,8 @@ export default {
if (!reference && this.$refs.wrapper.children) {
reference = this.referenceElm = this.$refs.wrapper.children[0];
}
this.referenceElement = reference;
// 访
if (reference) {
addClass(reference, 'el-popover__reference');

View File

@ -56,7 +56,8 @@ export default {
data() {
return {
showPopper: false,
currentPlacement: ''
currentPlacement: '',
referenceElement: null
};
},