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) {
232232 }
233233}
234234
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+
235249/**
236250 * Merge two option objects into a new one.
237251 * Core utility used in both instantiation and inheritance.
@@ -244,6 +258,7 @@ function guardComponents (components) {
244258
245259exports . mergeOptions = function merge ( parent , child , vm ) {
246260 guardComponents ( child . components )
261+ guardProps ( child )
247262 var options = { }
248263 var key
249264 if ( child . mixins ) {
You can’t perform that action at this time.
0 commit comments