File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,20 @@ function guardComponents (components) {
232
232
}
233
233
}
234
234
235
+ function guardProps ( child ) {
236
+ var props = child . props
237
+ if ( _ . isPlainObject ( props ) ) {
238
+ child . props = Object . keys ( props ) . map ( function ( key ) {
239
+ var val = props [ key ]
240
+ if ( ! _ . isPlainObject ( val ) ) {
241
+ val = { type : val }
242
+ }
243
+ val . name = key
244
+ return val
245
+ } )
246
+ }
247
+ }
248
+
235
249
/**
236
250
* Merge two option objects into a new one.
237
251
* Core utility used in both instantiation and inheritance.
@@ -244,6 +258,7 @@ function guardComponents (components) {
244
258
245
259
exports . mergeOptions = function merge ( parent , child , vm ) {
246
260
guardComponents ( child . components )
261
+ guardProps ( child )
247
262
var options = { }
248
263
var key
249
264
if ( child . mixins ) {
You can’t perform that action at this time.
0 commit comments