mirror of https://github.com/ElemeFE/element
Dialog: ignore width when fullscreen is true (#12203)
parent
156fccd834
commit
484725b15f
|
@ -129,11 +129,11 @@
|
||||||
computed: {
|
computed: {
|
||||||
style() {
|
style() {
|
||||||
let style = {};
|
let style = {};
|
||||||
|
if (!this.fullscreen) {
|
||||||
|
style.marginTop = this.top;
|
||||||
if (this.width) {
|
if (this.width) {
|
||||||
style.width = this.width;
|
style.width = this.width;
|
||||||
}
|
}
|
||||||
if (!this.fullscreen) {
|
|
||||||
style.marginTop = this.top;
|
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,8 +134,10 @@ describe('Dialog', () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
it('fullscreen', () => {
|
it('fullscreen', () => {
|
||||||
vm = getDialogVm('fullscreen');
|
vm = getDialogVm('fullscreen width="40%"');
|
||||||
expect(vm.$el.querySelector('.el-dialog').classList.contains('is-fullscreen')).to.true;
|
const dialogEl = vm.$el.querySelector('.el-dialog');
|
||||||
|
expect(dialogEl.classList.contains('is-fullscreen')).to.true;
|
||||||
|
expect(dialogEl.style.width).to.be.empty;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('top', () => {
|
it('top', () => {
|
||||||
|
|
Loading…
Reference in New Issue