Exposing a template ref does not work properly
Vue version
3.2.37
Link to minimal reproduction
Steps to reproduce
expose a template ref (with exposed props)
What is expected?
The outer (App.vue) should be able to access the template refs number
.
What is actually happening?
he outer (App.vue) is not able to access the template refs number
.
System Info
No response
Any additional comments?
Devtools are actually updating compRef.number
your defineExpose
call in Comp.vue is incorrect. defineExpose()
expects an object, not a ref.
Consequently your accessing in the parent was also wrong.
your
defineExpose
call in Comp.vue is incorrect.defineExpose()
expects an object, not a ref.Consequently your accessing in the parent was also wrong.
fair point. was more POC
If you don't want to nest these refs, maybe this is what you want?
I am looking for a way to easily funnel all the methods to the parent. So that i can wrap a external component to add some extras without losing the api/ without exposing every exposed methode separatly.. 🤔
Like this, maybe its a feature request?
your
defineExpose
call in Comp.vue is incorrect.defineExpose()
expects an object, not a ref. Consequently your accessing in the parent was also wrong. https://sfc.vuejs.org/#eNqFk01PwzAMhv+KlcuGtDUqiMvUDSHElQPnXPaRsU7Nh5J0IFX979hp1rWDwa1x7Nd+n7gNe7Y2O9WSLVjht660AbwMtV0JXSprXIAGnNxDC3tnFEwwddJfvRhlUzzjdCAlvBZ6a7QPsMXQOxYvSWKq66q6E7rgXR/sgIcgla3WQeIJoDjkq7dabaSDUkOabAFNc1Z6yugjj1+6S2zbgmNZLI/zYKulYKlAsFURJ8OEgvfN2Ix1FuZqbbOjNxr9N6Qh0oUXDBtThGI4Bp0FO4Rg/YJzv9/SbEefGffB8StztQ6lkpn0ar5x5tNLh8KCzQYaHIMn6eZO6p100v2leZX6Q5dkW6FbtHImT2844ClCcbiPYAAuVM/JPdYrmhEkT4WRaD5ASsk9U6I+gBrf88YOocLNDcpHK5SnHUJkgy2ivuM1EshlX2r5+mWNl9OLF2jjbb9mCVDU/YXQQzQqwphQzCZEHZceS5ddlNrWAU5zZXayQjRdlmD8fyICt+QGE0APZDi9RWc3f0Q7BANgbLh72NSZlmH4b7H2G8s0VHE=fair point. was more POC
I am looking for a way to easily funnel all the methods to the parent. So that i can wrap a external component to add some extras without losing the api/ without exposing every exposed methode separatly.. 🤔
Like this, maybe its a feature request?
I am also looking for a way to easily funnel all the methods to the parent.Did you solve it?