Commit 484725b1 authored by hetech's avatar hetech Committed by GitHub

Dialog: ignore width when fullscreen is true (#12203)

parent 156fccd8
...@@ -129,11 +129,11 @@ ...@@ -129,11 +129,11 @@
computed: { computed: {
style() { style() {
let style = {}; let style = {};
if (this.width) {
style.width = this.width;
}
if (!this.fullscreen) { if (!this.fullscreen) {
style.marginTop = this.top; style.marginTop = this.top;
if (this.width) {
style.width = this.width;
}
} }
return style; return style;
} }
......
...@@ -134,8 +134,10 @@ describe('Dialog', () => { ...@@ -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', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment