Skip to content

Commit e438fd8

Browse files
posvayyx990803
authored andcommitted
Fix props display when defined only in mixin (vuejs#306)
Fixes vuejs#304
1 parent 8e7262e commit e438fd8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/backend/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,19 +367,21 @@ function processProps (instance) {
367367
})
368368
} else if ((props = instance.$options.props)) {
369369
// 2.0
370-
return Object.keys(props).map(key => {
370+
const propsData = []
371+
for (let key in props) {
371372
const prop = props[key]
372373
key = camelize(key)
373-
return {
374+
propsData.push({
374375
type: 'props',
375376
key,
376377
value: instance[key],
377378
meta: {
378379
type: prop.type ? getPropType(prop.type) : 'any',
379380
required: !!prop.required
380381
}
381-
}
382-
})
382+
})
383+
}
384+
return propsData
383385
} else {
384386
return []
385387
}

0 commit comments

Comments
 (0)