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