Skip to content

Commit 2f35c99

Browse files
committed
fix required prop warning when using propsData (fix vuejs#3668)
1 parent 9c6a341 commit 2f35c99

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/compiler/compile-props.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ export function compileProps (el, propOptions, vm) {
145145
'kebab-case for props in templates.',
146146
vm
147147
)
148-
} else if (options.required) {
148+
} else if (options.required && (
149+
!propsData || (
150+
!(name in propsData) &&
151+
!(path in propsData)
152+
)
153+
)) {
149154
// warn missing required
150155
warn('Missing required prop: ' + name, vm)
151156
}

0 commit comments

Comments
 (0)