Closed znck closed 7 years ago
Provide/Inject allows ancestor component to serve as a dependency injector. Injected dependencies are not reactive. As per docs, if an observed property is provided it remains reactive.
I've created a fiddle (https://jsfiddle.net/1hcpbrjz/6/) to demonstrate few scenarios.
This feature is very new, so docs are too shallow.
Question: How to provide reactive data props and computed prop?
Update: 3rd March
( #5075 ) Initialising injections before state would allow using injections in props. https://jsfiddle.net/fsurfc5w/
Provide an object with reactive data inside.
@Akryum Can you update the fiddle with an example?
I think we should add some examples in docs too.
https://github.com/vuejs/vue/pull/5075
https://github.com/vuejs/vue/pull/5229
Provide/Inject allows ancestor component to serve as a dependency injector. Injected dependencies are not reactive. As per docs, if an observed property is provided it remains reactive.
I've created a fiddle (https://jsfiddle.net/1hcpbrjz/6/) to demonstrate few scenarios.
This feature is very new, so docs are too shallow.
Question: How to provide reactive data props and computed prop?
( #5075 ) Initialising injections before state would allow using injections in props. https://jsfiddle.net/fsurfc5w/