File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -203,7 +203,9 @@ describe('api: expose', () => {
203203 return h ( 'div' )
204204 } ,
205205 setup ( _ , { expose } ) {
206- expose ( )
206+ expose ( {
207+ foo : 42
208+ } )
207209 return ( ) => h ( GrandChild , { ref : grandChildRef } )
208210 }
209211 } )
@@ -216,7 +218,10 @@ describe('api: expose', () => {
216218 }
217219 const root = nodeOps . createElement ( 'div' )
218220 render ( h ( Parent ) , root )
221+ expect ( '$el' in childRef . value ) . toBe ( true )
219222 expect ( childRef . value . $el . tag ) . toBe ( 'div' )
223+ expect ( 'foo' in childRef . value ) . toBe ( true )
224+ expect ( '$parent' in grandChildRef . value ) . toBe ( true )
220225 expect ( grandChildRef . value . $parent ) . toBe ( childRef . value )
221226 expect ( grandChildRef . value . $parent . $parent ) . toBe ( grandChildRef . value . $root )
222227 } )
Original file line number Diff line number Diff line change @@ -945,6 +945,9 @@ export function getExposeProxy(instance: ComponentInternalInstance) {
945945 } else if ( key in publicPropertiesMap ) {
946946 return publicPropertiesMap [ key ] ( instance )
947947 }
948+ } ,
949+ has ( target , key : string ) {
950+ return key in target || key in publicPropertiesMap
948951 }
949952 } ) )
950953 )
You can’t perform that action at this time.
0 commit comments