mirror of https://github.com/ElemeFE/element
DatePicker: fix change type popper position change (#21140)
parent
6bbc046563
commit
2554f9a0d5
|
@ -86,8 +86,14 @@ export default {
|
|||
|
||||
const options = this.popperOptions;
|
||||
const popper = this.popperElm = this.popperElm || this.popper || this.$refs.popper;
|
||||
let reference = this.referenceElm = this.referenceElm || this.reference || this.$refs.reference;
|
||||
|
||||
let reference = this.referenceElm = this.referenceElm || this.reference;
|
||||
if (this.$refs.reference) {
|
||||
if (this.$refs.reference.$el) {
|
||||
reference = this.$refs.reference.$el;
|
||||
} else {
|
||||
reference = this.$refs.reference;
|
||||
}
|
||||
}
|
||||
if (!reference &&
|
||||
this.$slots.reference &&
|
||||
this.$slots.reference[0]) {
|
||||
|
@ -159,12 +165,11 @@ export default {
|
|||
|
||||
appendArrow(element) {
|
||||
let hash;
|
||||
if (this.appended) {
|
||||
let arrowClassName = 'popper__arrow';
|
||||
if (element.getElementsByClassName(arrowClassName).length) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.appended = true;
|
||||
|
||||
for (let item in element.attributes) {
|
||||
if (/^_v-/.test(element.attributes[item].name)) {
|
||||
hash = element.attributes[item].name;
|
||||
|
@ -178,7 +183,7 @@ export default {
|
|||
arrow.setAttribute(hash, '');
|
||||
}
|
||||
arrow.setAttribute('x-arrow', '');
|
||||
arrow.className = 'popper__arrow';
|
||||
arrow.className = arrowClassName;
|
||||
element.appendChild(arrow);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue