mirror of https://github.com/ElemeFE/element
Merge pull request #2396 from QingWei-Li/fix/table/nodata-width
Table: fix body width when no datapull/2153/merge
commit
5af2d39714
|
@ -31,9 +31,9 @@
|
||||||
:row-class-name="rowClassName"
|
:row-class-name="rowClassName"
|
||||||
:row-style="rowStyle"
|
:row-style="rowStyle"
|
||||||
:highlight="highlightCurrentRow"
|
:highlight="highlightCurrentRow"
|
||||||
:style="{ width: layout.bodyWidth ? layout.bodyWidth - (layout.scrollY ? layout.gutterWidth : 0 ) + 'px' : '' }">
|
:style="{ width: bodyWidth }">
|
||||||
</table-body>
|
</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>
|
<span class="el-table__empty-text"><slot name="empty">{{ emptyText || t('el.table.emptyText') }}</slot></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -297,6 +297,11 @@
|
||||||
return style;
|
return style;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
bodyWidth() {
|
||||||
|
const { bodyWidth, scrollY, gutterWidth } = this.layout;
|
||||||
|
return bodyWidth ? bodyWidth - (scrollY ? gutterWidth : 0) + 'px' : '';
|
||||||
|
},
|
||||||
|
|
||||||
fixedBodyHeight() {
|
fixedBodyHeight() {
|
||||||
let style = {};
|
let style = {};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue