Subscribe on changes!

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..

avatar
Nov 23rd 2023

Vue version

"vue": "^3.3.4"

Link to minimal reproduction

https://play.vuejs.org/#eNqFU8tu2zAQ/BVCl9ioI0EwenFlow/4kB7SIu2RF1le23QkkuDDcWHo37t8SJHiGLmRu8vZ2dnhJfkmZXqykCySQleKSUM0GCtXlLNGCmXIhSjYkZbslGjIHZbe9akfopExnmbu4pAwTXkluDakwtATPl46iAm3dT2lvMhCH+yAFwONrEsDeCOk2FhjBCdfq5pVz0uaRICU8UpBqWEypcnqIV5C58i/yMLbgOOJYc9XCHxXeIpYUGR912SWhFnum1KmRy04CnFxGDQmNE0WxEdcDDu5O00Oxki9yDKE+ef6H3Uq1D7DU6osN6yBFHRzv1HiRYNCZJo4jJbyFnt2WjnVBwpQ864C+ZUEgU4vBLfNBlTQo4P2OlyJkg9UcbC9LPlYF7+bG35AhJlfrTWwvW2MfOSMPFoDRRyYw1EYu4PyLewYh/VZChy2K/KZ3jlRQY95LeFh7uel5jHIwnjg46pxlZegVourcAr56g8mp7jPfvbxwATncNPEFYRZ8s/I103aZbvlYX4yXa6incKb9FTWFsinJcm/RIuEpyMh4pMOyBcOPxNKYjQ227H9Gxs7CVkN6pc0DMmM7FzWtXj56WNGWZh18eoA1fM78aM+B/v/VoC2PuFn6HOmVHswIb3+8whnPPfJRmxtHb/OjeQTaFFbxzGUfbd8i7QHdZ7tg98E4/u/en02wHU3lCPqZfH1/qu6td8a/ZXuPJ33X7P9DzgLuAo=

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?

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..

What should I do !

avatar
Nov 23rd 2023

Bro you need to read a little bit the documentation the behavior that are you looking for is here Provider & Inject

Please keep in the mind that this channel is just for bug relations or things related to the vuejs core development, for another points they recommend to use community channels around the round.

avatar
Nov 23rd 2023

Bro you need to read a little bit the documentation the behavior that are you looking for is here Provider & Inject

Please keep in the mind that this channel is just for bug relations or things related to the vuejs core development, for another points they recommend to use community channels around the round.

You may not understand what I mean

We are facing the same problem but have not provided a solution see to https://github.com/vuejs/core/issues/6540 @lpj145

avatar
Nov 23rd 2023

Bro I get your point and the relation with the #6540 but you need to understand it's a bad design idea, I know you should be able to do this, but this is main reason why the Dependency api was developed, but by the way if you want to continue in this way, every defineExpose should be called with a plain object with references to the internal component references, it will works, but, you see that it's a bad design idea, the Provider & Inject + Composables will be your best friend right now 😄

avatar
Nov 23rd 2023

the Provider & Inject + Composables
Can you explain it in detail? My question is how to expose functions of third-party components , There may be many functions of third-party components, what would you do ? Can you give an example? @lpj145

That's what I'm doing now:

Components for secondary packaging: virtualized-table.vue image