Table: fix body width when no data

pull/2396/head
qingwei.li 2017-01-13 16:38:37 +08:00
parent d5f4603f59
commit 8e36cee37c
1 changed files with 7 additions and 2 deletions

View File

@ -31,9 +31,9 @@
:row-class-name="rowClassName"
:row-style="rowStyle"
:highlight="highlightCurrentRow"
:style="{ width: layout.bodyWidth ? layout.bodyWidth - (layout.scrollY ? layout.gutterWidth : 0 ) + 'px' : '' }">
:style="{ width: bodyWidth }">
</table-body>
<div class="el-table__empty-block" v-if="!data || data.length === 0">
<div :style="{ width: bodyWidth }" class="el-table__empty-block" v-if="!data || data.length === 0">
<span class="el-table__empty-text"><slot name="empty">{{ emptyText || t('el.table.emptyText') }}</slot></span>
</div>
</div>
@ -297,6 +297,11 @@
return style;
},
bodyWidth() {
const { bodyWidth, scrollY, gutterWidth } = this.layout;
return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
},
fixedBodyHeight() {
let style = {};