@@ -9,7 +9,7 @@ export default function wrapWithConnect (WrappedComponent) {
99 const tempProps = WrappedComponent . props || { }
1010 const methods = WrappedComponent . methods || { }
1111 const props = { }
12- Object . keys ( tempProps ) . forEach ( k => { props [ k ] = PropTypes . any } )
12+ Object . keys ( tempProps ) . forEach ( k => { props [ k ] = ( { ... k , required : false } ) } )
1313 WrappedComponent . props . __propsSymbol__ = PropTypes . any
1414 WrappedComponent . props . children = PropTypes . array . def ( [ ] )
1515 const ProxyWrappedComponent = {
@@ -22,19 +22,24 @@ export default function wrapWithConnect (WrappedComponent) {
2222 } ,
2323 } ,
2424 render ( ) {
25- const { $listeners, $slots = { } , $attrs } = this
25+ const { $listeners, $slots = { } , $attrs, $scopedSlots } = this
2626 const props = getOptionProps ( this )
2727 const wrapProps = {
2828 props : {
2929 ...props ,
3030 __propsSymbol__ : Symbol ( ) ,
31- children : $slots . default || [ ] ,
31+ children : $slots . default || props . children || [ ] ,
3232 } ,
3333 on : $listeners ,
3434 attrs : $attrs ,
35+ scopedSlots : $scopedSlots ,
3536 }
3637 return (
37- < WrappedComponent { ...wrapProps } ref = 'wrappedInstance' />
38+ < WrappedComponent { ...wrapProps } ref = 'wrappedInstance' >
39+ { Object . keys ( $slots ) . map ( name => {
40+ return < template slot = { name } > { $slots [ name ] } </ template >
41+ } ) }
42+ </ WrappedComponent >
3843 )
3944 } ,
4045 }
0 commit comments