File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,9 @@ describe('api: expose', () => {
203
203
return h ( 'div' )
204
204
} ,
205
205
setup ( _ , { expose } ) {
206
- expose ( )
206
+ expose ( {
207
+ foo : 42
208
+ } )
207
209
return ( ) => h ( GrandChild , { ref : grandChildRef } )
208
210
}
209
211
} )
@@ -216,7 +218,10 @@ describe('api: expose', () => {
216
218
}
217
219
const root = nodeOps . createElement ( 'div' )
218
220
render ( h ( Parent ) , root )
221
+ expect ( '$el' in childRef . value ) . toBe ( true )
219
222
expect ( childRef . value . $el . tag ) . toBe ( 'div' )
223
+ expect ( 'foo' in childRef . value ) . toBe ( true )
224
+ expect ( '$parent' in grandChildRef . value ) . toBe ( true )
220
225
expect ( grandChildRef . value . $parent ) . toBe ( childRef . value )
221
226
expect ( grandChildRef . value . $parent . $parent ) . toBe ( grandChildRef . value . $root )
222
227
} )
Original file line number Diff line number Diff line change @@ -945,6 +945,9 @@ export function getExposeProxy(instance: ComponentInternalInstance) {
945
945
} else if ( key in publicPropertiesMap ) {
946
946
return publicPropertiesMap [ key ] ( instance )
947
947
}
948
+ } ,
949
+ has ( target , key : string ) {
950
+ return key in target || key in publicPropertiesMap
948
951
}
949
952
} ) )
950
953
)
You can’t perform that action at this time.
0 commit comments