-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
Description
Version
2.4.1
Reproduction link
https://jsfiddle.net/d92sL0zy/2/
Steps to reproduce
- Create mixin that sets the
injectoption - Create component that uses said mixin
- Use component in context with a corresponding
provide
What is expected?
The data provided in the context is correctly injected into the component that uses the mixin with the inject option set.
What is actually happening?
The data provided is not injected into the component that uses the mixin, unless the inject option is specified directly on the component and not in the mixin.
I use the pattern of specifying provide and inject options on mixins extensively, as this provides some really useful mixins for specifying relationships between different components. A component using a hasOne() mixin would for example provide itself to a child which would then use a memberOf() mixin to inject the parent. As of Vue 2.4.0 , this however no longer works as the inject option of the memberOf() mixin is ignored.
rayrutjes, sqal, pdanpdan, JCharante, lehni and 2 more