Table: Fix wrong height when switch prop height. (#2979)

pull/2988/head
Cyril Su 2017-02-23 11:31:25 +08:00 committed by cinwell.li
parent f1c44858e7
commit f1913d991d
1 changed files with 20 additions and 1 deletions

View File

@ -8,7 +8,8 @@
'el-table--enable-row-hover': !store.states.isComplex,
'el-table--enable-row-transition': true || (store.states.data || []).length !== 0 && (store.states.data || []).length < 100
}"
@mouseleave="handleMouseLeave($event)">
@mouseleave="handleMouseLeave($event)"
:style="[tableHeight]">
<div class="hidden-columns" ref="hiddenColumns"><slot></slot></div>
<div class="el-table__header-wrapper" ref="headerWrapper" v-if="showHeader">
<table-header
@ -294,6 +295,24 @@
return style;
},
tableHeight() {
let style = {};
const height = this.layout.tableHeight ? this.layout.tableHeight + 'px' : '';
if (this.height) {
style = {
height
};
} else if (this.maxHeight) {
style = {
'max-height': height
};
}
return style;
},
bodyWidth() {
const { bodyWidth, scrollY, gutterWidth } = this.layout;
return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';