-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject option in mixin no longer works #6093
Labels
Comments
Sorry, it should be introduced by #5827. My fault...😭 Will try to fix it... |
No worries! Reverted to 2.3.4 in the meantime, so no harm done 👌 |
This was referenced Jul 13, 2017
12 tasks
12 tasks
This also happens when trying to extend a component that implements |
Before this have been fixed, you can customize the merge strategy of inject option to make a workaround. Some kinda like: Vue.config.optionMergeStrategies.inject = function (parent, child) {
return Vue.util.extend(Vue.util.extend({}, parent), child)
} |
yyx990803
pushed a commit
that referenced
this issue
Jul 19, 2017
yyx990803
pushed a commit
that referenced
this issue
Jul 19, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
2.4.1
Reproduction link
https://jsfiddle.net/d92sL0zy/2/
Steps to reproduce
inject
optionprovide
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
andinject
options on mixins extensively, as this provides some really useful mixins for specifying relationships between different components. A component using ahasOne()
mixin would for exampleprovide
itself to a child which would then use amemberOf()
mixin toinject
the parent. As of Vue 2.4.0 , this however no longer works as theinject
option of thememberOf()
mixin is ignored.The text was updated successfully, but these errors were encountered: