8000 props: only warn twoWay if prop is present · Aphasia-GitHub/vue@0b4ebe5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b4ebe5

Browse files
committed
props: only warn twoWay if prop is present
1 parent f4b8e76 commit 0b4ebe5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/compile-props.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ module.exports = function compileProps (el, propOptions) {
140140
// warn required two-way
141141
if (
142142
process.env.NODE_ENV !== 'production' &&
143+
value !== null &&
143144
options.twoWay &&
144145
prop.mode !== propBindingModes.TWO_WAY
145146
) {
@@ -149,7 +150,7 @@ module.exports = function compileProps (el, propOptions) {
149150
}
150151

151152
// warn missing required
152-
if (value === null && options && options.required) {
153+
if (value === null && options.required) {
153154
process.env.NODE_ENV !== 'production' && _.warn(
154155
'Missing required prop: ' + name
155156
)

0 commit comments

Comments
 (0)
0