fix #4207
This commit is contained in:
parent
574ec50425
commit
72979a782a
2 changed files with 24 additions and 4 deletions
|
@ -149,6 +149,10 @@
|
||||||
height: {
|
height: {
|
||||||
type: [Number, String]
|
type: [Number, String]
|
||||||
},
|
},
|
||||||
|
// 3.4.0
|
||||||
|
maxHeight: {
|
||||||
|
type: [Number, String]
|
||||||
|
},
|
||||||
stripe: {
|
stripe: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
@ -275,6 +279,10 @@
|
||||||
const height = parseInt(this.height);
|
const height = parseInt(this.height);
|
||||||
style.height = `${height}px`;
|
style.height = `${height}px`;
|
||||||
}
|
}
|
||||||
|
if (this.maxHeight) {
|
||||||
|
const maxHeight = parseInt(this.maxHeight);
|
||||||
|
style.maxHeight = `${maxHeight}px`;
|
||||||
|
}
|
||||||
if (this.width) style.width = `${this.width}px`;
|
if (this.width) style.width = `${this.width}px`;
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
@ -336,7 +344,11 @@
|
||||||
let style = {};
|
let style = {};
|
||||||
if (this.bodyHeight !== 0) {
|
if (this.bodyHeight !== 0) {
|
||||||
const height = this.bodyHeight;
|
const height = this.bodyHeight;
|
||||||
|
if (this.height) {
|
||||||
style.height = `${height}px`;
|
style.height = `${height}px`;
|
||||||
|
} else if (this.maxHeight) {
|
||||||
|
style.maxHeight = `${height}px`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
@ -548,7 +560,7 @@
|
||||||
this.objData[_index]._isExpanded = status;
|
this.objData[_index]._isExpanded = status;
|
||||||
this.$emit('on-expand', JSON.parse(JSON.stringify(this.cloneData[_index])), status);
|
this.$emit('on-expand', JSON.parse(JSON.stringify(this.cloneData[_index])), status);
|
||||||
|
|
||||||
if(this.height){
|
if(this.height || this.maxHeight){
|
||||||
this.$nextTick(()=>this.fixedBody());
|
this.$nextTick(()=>this.fixedBody());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -578,12 +590,16 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
fixedHeader () {
|
fixedHeader () {
|
||||||
if (this.height) {
|
if (this.height || this.maxHeight) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const titleHeight = parseInt(getStyle(this.$refs.title, 'height')) || 0;
|
const titleHeight = parseInt(getStyle(this.$refs.title, 'height')) || 0;
|
||||||
const headerHeight = parseInt(getStyle(this.$refs.header, 'height')) || 0;
|
const headerHeight = parseInt(getStyle(this.$refs.header, 'height')) || 0;
|
||||||
const footerHeight = parseInt(getStyle(this.$refs.footer, 'height')) || 0;
|
const footerHeight = parseInt(getStyle(this.$refs.footer, 'height')) || 0;
|
||||||
|
if (this.height) {
|
||||||
this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
|
this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
|
||||||
|
} else if (this.maxHeight) {
|
||||||
|
this.bodyHeight = this.maxHeight - titleHeight - headerHeight - footerHeight;
|
||||||
|
}
|
||||||
this.$nextTick(()=>this.fixedBody());
|
this.$nextTick(()=>this.fixedBody());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -986,6 +1002,9 @@
|
||||||
height () {
|
height () {
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
},
|
},
|
||||||
|
maxHeight () {
|
||||||
|
this.handleResize();
|
||||||
|
},
|
||||||
showHorizontalScrollBar () {
|
showHorizontalScrollBar () {
|
||||||
this.handleResize();
|
this.handleResize();
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
border: 1px solid @border-color-base;
|
border: 1px solid @border-color-base;
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
border-right: 0;
|
border-right: 0;
|
||||||
|
overflow: hidden; // 开启 max-height 时,没有 overflow: hidden,则底部多出 1px,早期没有 overflow 是因为有些控件没有加 transfer
|
||||||
}
|
}
|
||||||
width: inherit;
|
width: inherit;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
Loading…
Add table
Reference in a new issue