We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3b7c05d commit 8be29e2Copy full SHA for 8be29e2
src/core/util/options.js
@@ -334,6 +334,7 @@ function validatePropObject (
334
*/
335
function normalizeInject (options: Object, vm: ?Component) {
336
const inject = options.inject
337
+ if (!inject) return
338
const normalized = options.inject = {}
339
if (Array.isArray(inject)) {
340
for (let i = 0; i < inject.length; i++) {
@@ -346,7 +347,7 @@ function normalizeInject (options: Object, vm: ?Component) {
346
347
? extend({ from: key }, val)
348
: { from: val }
349
}
- } else if (process.env.NODE_ENV !== 'production' && inject) {
350
+ } else if (process.env.NODE_ENV !== 'production') {
351
warn(
352
`Invalid value for option "inject": expected an Array or an Object, ` +
353
`but got ${toRawType(inject)}.`,
0 commit comments