@@ -10,7 +10,7 @@ import Pagination from '../pagination'
10
10
import { Row } from '../grid'
11
11
12
12
import Item from './Item'
13
- import { initDefaultProps , getComponentFromProp } from '../_util/props-util'
13
+ import { initDefaultProps , getComponentFromProp , filterEmpty } from '../_util/props-util'
14
14
import { cloneElement } from '../_util/vnode'
15
15
16
16
export { ListItemProps , ListItemMetaProps } from './Item'
@@ -38,7 +38,7 @@ export const ListProps = () => ({
38
38
extra : PropTypes . any ,
39
39
grid : PropTypes . shape ( ListGridType ) . loose ,
40
40
itemLayout : PropTypes . string ,
41
- loading : PropTypes . oneOfType ( [ PropTypes . bool , SpinProps ( ) ] ) ,
41
+ loading : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . object ] ) ,
42
42
loadMore : PropTypes . any ,
43
43
pagination : PropTypes . any ,
44
44
prefixCls : PropTypes . string ,
@@ -139,7 +139,7 @@ export default {
139
139
const loadMore = getComponentFromProp ( this , 'loadMore' )
140
140
const footer = getComponentFromProp ( this , 'footer' )
141
141
const header = getComponentFromProp ( this , 'header' )
142
- const children = $slots . default || [ ]
142
+ const children = filterEmpty ( $slots . default || [ ] )
143
143
let loadingProp = loading
144
144
if ( typeof loadingProp === 'boolean' ) {
145
145
loadingProp = {
@@ -220,7 +220,7 @@ export default {
220
220
childrenContent = grid ? (
221
221
< Row gutter = { grid . gutter } > { childrenList } </ Row >
222
222
) : childrenList
223
- } else if ( ! children && ! isLoading ) {
223
+ } else if ( ! children . length && ! isLoading ) {
224
224
childrenContent = (
225
225
< LocaleReceiver
226
226
componentName = 'Table'
0 commit comments