mirror of https://github.com/ElemeFE/element
fix some styles
parent
ba27ca55d4
commit
54ced05415
|
@ -11,6 +11,10 @@
|
|||
margin: 5px 0;
|
||||
min-width: 513px;
|
||||
|
||||
&.has-sidebar {
|
||||
min-width: 620px;
|
||||
}
|
||||
|
||||
@e body, body-wrapper {
|
||||
&::after {
|
||||
content: "";
|
||||
|
|
|
@ -275,7 +275,7 @@
|
|||
disabledDate: '',
|
||||
leftTimePickerVisible: false,
|
||||
rightTimePickerVisible: false,
|
||||
width: 0
|
||||
width: ''
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@
|
|||
month: null,
|
||||
week: null,
|
||||
timePickerVisible: false,
|
||||
width: 0
|
||||
width: ''
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
minSeconds: minTime.getSeconds(),
|
||||
format: 'HH:mm:ss',
|
||||
visible: false,
|
||||
width: 0
|
||||
width: ''
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
value: '',
|
||||
visible: false,
|
||||
minTime: '',
|
||||
width: 0
|
||||
width: ''
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
selectableRange: [],
|
||||
currentDate: this.$options.defaultValue || this.date,
|
||||
currentVisible: this.visible,
|
||||
width: 0
|
||||
width: ''
|
||||
};
|
||||
},
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
mounted() {
|
||||
this.referenceElm = this.$parent.$refs.reference.$el;
|
||||
this.$parent.popperElm = this.popperElm = this.$el;
|
||||
this.$on('updatePopper', _ => { this.showPopper = true; });
|
||||
this.$on('destroyPopper', _ => { this.showPopper = false; });
|
||||
this.$on('updatePopper', this.updatePopper);
|
||||
this.$on('destroyPopper', this.destroyPopper);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -83,7 +83,10 @@ export default {
|
|||
options.placement = this.placement;
|
||||
options.offset = this.offset;
|
||||
this.popperJS = new PopperJS(reference, popper, options);
|
||||
this.popperJS.onCreate(_ => this.$emit('created', this));
|
||||
this.popperJS.onCreate(_ => {
|
||||
this.$emit('created', this);
|
||||
this.resetTransformOrigin();
|
||||
});
|
||||
this.popperJS._popper.style.zIndex = PopupManager.nextZIndex();
|
||||
},
|
||||
|
||||
|
@ -99,15 +102,15 @@ export default {
|
|||
|
||||
destroyPopper() {
|
||||
if (this.popperJS) {
|
||||
this.resetTransformOrigin(this.popperJS);
|
||||
this.resetTransformOrigin();
|
||||
}
|
||||
},
|
||||
|
||||
resetTransformOrigin(popper) {
|
||||
resetTransformOrigin() {
|
||||
let placementMap = { top: 'bottom', bottom: 'top', left: 'right', right: 'left' };
|
||||
let placement = popper._popper.getAttribute('x-placement').split('-')[0];
|
||||
let placement = this.popperJS._popper.getAttribute('x-placement').split('-')[0];
|
||||
let origin = placementMap[placement];
|
||||
popper._popper.style.transformOrigin = ['top', 'bottom'].indexOf(placement) > -1 ? `center ${ origin }` : `${ origin } center`;
|
||||
this.popperJS._popper.style.transformOrigin = ['top', 'bottom'].indexOf(placement) > -1 ? `center ${ origin }` : `${ origin } center`;
|
||||
},
|
||||
|
||||
appendArrow(element) {
|
||||
|
|
Loading…
Reference in New Issue