delay render

This commit is contained in:
shaohaojiecoder
2020-12-13 16:42:17 +08:00
parent fb9186aa1e
commit 0cac7fa3f4
2 changed files with 19 additions and 0 deletions

View File

@@ -20,6 +20,10 @@ export default {
type: [String, Function],
default: 'key'
},
loaded: {
type: Boolean,
default: true
},
data: {
type: Function,
required: true
@@ -265,6 +269,14 @@ export default {
},
render () {
if (!this.loaded) {
return (
<div style="width: 100%; height:160px; text-align: center; line-height:160px">
<a-spin tip="Loading...">
</a-spin>
</div>
)
}
const props = {}
const localKeys = Object.keys(this.$data)
const showAlert = (typeof this.alert === 'object' && this.alert !== null && this.alert.show) && typeof this.rowSelection.selectedRowKeys !== 'undefined' || this.alert