@@ -9,7 +9,7 @@ export default function wrapWithConnect (WrappedComponent) {
9
9
const tempProps = WrappedComponent . props || { }
10
10
const methods = WrappedComponent . methods || { }
11
11
const props = { }
12
- Object . keys ( tempProps ) . forEach ( k => { props [ k ] = PropTypes . any } )
12
+ Object . keys ( tempProps ) . forEach ( k => { props [ k ] = ( { ... k , required : false } ) } )
13
13
WrappedComponent . props . __propsSymbol__ = PropTypes . any
14
14
WrappedComponent . props . children = PropTypes . array . def ( [ ] )
15
15
const ProxyWrappedComponent = {
@@ -22,19 +22,24 @@ export default function wrapWithConnect (WrappedComponent) {
22
22
} ,
23
23
} ,
24
24
render ( ) {
25
- const { $listeners, $slots = { } , $attrs } = this
25
+ const { $listeners, $slots = { } , $attrs, $scopedSlots } = this
26
26
const props = getOptionProps ( this )
27
27
const wrapProps = {
28
28
props : {
29
29
...props ,
30
30
__propsSymbol__ : Symbol ( ) ,
31
- children : $slots . default || [ ] ,
31
+ children : $slots . default || props . children || [ ] ,
32
32
} ,
33
33
on : $listeners ,
34
34
attrs : $attrs ,
35
+ scopedSlots : $scopedSlots ,
35
36
}
36
37
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 >
38
43
)
39
44
} ,
40
45
}
0 commit comments