mirror of https://github.com/ElemeFE/element
Dialog: ignore width when fullscreen is true (#12203)
parent
156fccd834
commit
484725b15f
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue