Merge pull request #200 from rijn/194

Fade table body when there is no data
This commit is contained in:
Aresn 2017-01-13 15:58:19 +08:00 committed by GitHub
commit 73dc2dedfe
2 changed files with 26 additions and 16 deletions

View file

@ -11,7 +11,8 @@
:columns-width="columnsWidth"
:data="rebuildData"></table-head>
</div>
<div :class="[prefixCls + '-body']" :style="bodyStyle" v-el:body @scroll="handleBodyScroll">
<div :class="[prefixCls + '-body']" :style="bodyStyle" v-el:body @scroll="handleBodyScroll"
v-show="!((!!noDataText && (!data || data.length === 0)) || (!!noFilteredDataText && (!rebuildData || rebuildData.length === 0)))">
<table-body
v-ref:tbody
:prefix-cls="prefixCls"
@ -21,6 +22,19 @@
:columns-width="columnsWidth"
:obj-data="objData"></table-body>
</div>
<div
:class="[prefixCls + '-tip']"
v-else>
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td :style="{ 'height': bodyStyle.height }">
{{{!data || data.length === 0 ? noDataText : noFilteredDataText}}}
</td>
</tr>
</tbody>
</table>
</div>
<div :class="[prefixCls + '-fixed']" :style="fixedTableStyle" v-if="isLeftFixed">
<div :class="[prefixCls + '-fixed-header']" v-if="showHeader">
<table-head
@ -65,19 +79,6 @@
:obj-data="objData"></table-body>
</div>
</div>
<div
:class="[prefixCls + '-tip']"
v-show="(!!noDataText && (!data || data.length === 0)) || (!!noFilteredDataText && (!rebuildData || rebuildData.length === 0))">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
{{{!data || data.length === 0 ? noDataText : noFilteredDataText}}}
</td>
</tr>
</tbody>
</table>
</div>
<div :class="[prefixCls + '-footer']" v-if="showSlotFooter" v-el:footer><slot name="footer"></slot></div>
</div>
</div>