-
-
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
Merge inject when extending a component #5827
Conversation
Actually I have been seeing this issue for several days. But I'm not sure that if the behavior So please let me know if this use case valid, and I'll add test case to it. |
src/core/util/options.js
Outdated
*/ | ||
function normalizeInject (options: Object) { | ||
const inject = options.inject | ||
if (!inject) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The normalization is only needed if inject
is an Array, so we can just return if it is not an Array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, with normalization here, we should be able to simplify the resolveInject
function here since the normalized value will always be objects: https://github.com/vuejs/vue/blob/dev/src/core/instance/inject.js#L38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will look into it later.
This reverts commit 8466a28.
@yyx990803 thanks 🎉 |
* 'dev' of https://github.com/vuejs/vue: build: use cross-platform hook installation with shelljs build: move test config files into /test build: add script for generating release note build: add git commit message validation fix(v-model): use consistent behavior during IME composition for other text-like input types (fix vuejs#5902) simplify source with rest params fix slot resolved incorrect with abstract component (fix vuejs#5888) (vuejs#5895) test:improve reserved props test test:add bind object test fix:when using object syntax in v-bind, special attribute have no effect Be able to use string type index in array (vuejs#5889) Merge inject when extending a component (vuejs#5827) # Conflicts: # .gitignore # src/core/util/options.js
#5603
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
dev
branch for v2.x (or to a previous version branch), not themaster
branchfix #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: