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

pull/12208/head
hetech 2018-08-02 11:27:30 +08:00 committed by GitHub
parent 156fccd834
commit 484725b15f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -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;
} }

View File

@ -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', () => {