return h('div')
},
setup(_, { expose }) {
- expose()
+ expose({
+ foo: 42
+ })
return () => h(GrandChild, { ref: grandChildRef })
}
})
}
const root = nodeOps.createElement('div')
render(h(Parent), root)
+ expect('$el' in childRef.value).toBe(true)
expect(childRef.value.$el.tag).toBe('div')
+ expect('foo' in childRef.value).toBe(true)
+ expect('$parent' in grandChildRef.value).toBe(true)
expect(grandChildRef.value.$parent).toBe(childRef.value)
expect(grandChildRef.value.$parent.$parent).toBe(grandChildRef.value.$root)
})
} else if (key in publicPropertiesMap) {
return publicPropertiesMap[key](instance)
}
+ },
+ has(target, key: string) {
+ return key in target || key in publicPropertiesMap
}
}))
)