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: {
style() {
let style = {};
if (this.width) {
style.width = this.width;
}
if (!this.fullscreen) {
style.marginTop = this.top;
if (this.width) {
style.width = this.width;
}
}
return style;
}

View File

@ -134,8 +134,10 @@ describe('Dialog', () => {
};
it('fullscreen', () => {
vm = getDialogVm('fullscreen');
expect(vm.$el.querySelector('.el-dialog').classList.contains('is-fullscreen')).to.true;
vm = getDialogVm('fullscreen width="40%"');
const dialogEl = vm.$el.querySelector('.el-dialog');
expect(dialogEl.classList.contains('is-fullscreen')).to.true;
expect(dialogEl.style.width).to.be.empty;
});
it('top', () => {