@@ -10,7 +10,7 @@ import Pagination from '../pagination'
1010import { Row } from '../grid'
1111
1212import Item from './Item'
13- import { initDefaultProps , getComponentFromProp } from '../_util/props-util'
13+ import { initDefaultProps , getComponentFromProp , filterEmpty } from '../_util/props-util'
1414import { cloneElement } from '../_util/vnode'
1515
1616export { ListItemProps , ListItemMetaProps } from './Item'
@@ -38,7 +38,7 @@ export const ListProps = () => ({
3838 extra : PropTypes . any ,
3939 grid : PropTypes . shape ( ListGridType ) . loose ,
4040 itemLayout : PropTypes . string ,
41- loading : PropTypes . oneOfType ( [ PropTypes . bool , SpinProps ( ) ] ) ,
41+ loading : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . object ] ) ,
4242 loadMore : PropTypes . any ,
4343 pagination : PropTypes . any ,
4444 prefixCls : PropTypes . string ,
@@ -139,7 +139,7 @@ export default {
139139 const loadMore = getComponentFromProp ( this , 'loadMore' )
140140 const footer = getComponentFromProp ( this , 'footer' )
141141 const header = getComponentFromProp ( this , 'header' )
142- const children = $slots . default || [ ]
142+ const children = filterEmpty ( $slots . default || [ ] )
143143 let loadingProp = loading
144144 if ( typeof loadingProp === 'boolean' ) {
145145 loadingProp = {
@@ -220,7 +220,7 @@ export default {
220220 childrenContent = grid ? (
221221 < Row gutter = { grid . gutter } > { childrenList } </ Row >
222222 ) : childrenList
223- } else if ( ! children && ! isLoading ) {
223+ } else if ( ! children . length && ! isLoading ) {
224224 childrenContent = (
225225 < LocaleReceiver
226226 componentName = 'Table'
0 commit comments