DEV Community

Discussion on: Leverage `provide/inject` to avoid prop drilling in Vue.js

Collapse
 
yellow1912 profile image
yellow1912

Can you somehow make inject dynamic? Let's say you have a listing component with dynamic templates (perhaps using inline-template): one listing one you may want to inject some onclick handler, on listing 2 you want to in an additional on hover handler etc...

Collapse
 
grawl profile image
Даниил Пронин

Just solved this problem with this: github.com/egoist/vue-provider

I am using Quasar Framework and running now in SSR + PWA mode, all provided props is reactive.

Collapse
 
grawl profile image
Даниил Пронин

Oh no, it calls re-render for any changes. And I cannot figure out why.