mirror of https://github.com/ElemeFE/element
Table: add empty text
parent
4dd8b094cb
commit
59ed4984dc
|
@ -19,6 +19,9 @@
|
||||||
:row-class-name="rowClassName"
|
:row-class-name="rowClassName"
|
||||||
:style="{ width: layout.bodyWidth ? layout.bodyWidth - (layout.scrollY ? layout.gutterWidth : 0 ) + 'px' : '' }">
|
:style="{ width: layout.bodyWidth ? layout.bodyWidth - (layout.scrollY ? layout.gutterWidth : 0 ) + 'px' : '' }">
|
||||||
</table-body>
|
</table-body>
|
||||||
|
<div class="el-table__empty-block" v-if="!data || data.length === 0">
|
||||||
|
<span class="el-table__empty-text">{{ emptyText }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="el-table__fixed" ref="fixedWrapper"
|
<div class="el-table__fixed" ref="fixedWrapper"
|
||||||
:style="{
|
:style="{
|
||||||
|
@ -123,7 +126,12 @@
|
||||||
|
|
||||||
rowKey: [String, Function],
|
rowKey: [String, Function],
|
||||||
|
|
||||||
rowClassName: [String, Function]
|
rowClassName: [String, Function],
|
||||||
|
|
||||||
|
emptyText: {
|
||||||
|
type: String,
|
||||||
|
default: '暂无数据'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
|
@ -43,6 +43,20 @@
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@e empty-block {
|
||||||
|
display: table;
|
||||||
|
min-height: 60px;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@e empty-text {
|
||||||
|
display: table-cell;
|
||||||
|
vertical-align: middle;
|
||||||
|
color: #5e6d82;
|
||||||
|
}
|
||||||
|
|
||||||
@modifier fit {
|
@modifier fit {
|
||||||
border-right: 0;
|
border-right: 0;
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
|
|
Loading…
Reference in New Issue