Skip to content

Commit f127b68

Browse files
authored
Correct default value for absent props.
The Boolean missing prop will cast to false instead of undefined, vuejs/core#5863 (comment)
1 parent 8b584ee commit f127b68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/guide/components/props.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ Additional details:
482482

483483
- All props are optional by default, unless `required: true` is specified.
484484

485-
- An absent optional prop will have `undefined` value.
485+
- An absent optional prop other than `Boolean` will have `undefined` value.
486+
487+
- The `Boolean` absent props will be cast to `false`. You should set a `default` value for it in order to get desired behavior.
486488

487489
- If a `default` value is specified, it will be used if the resolved prop value is `undefined` - this includes both when the prop is absent, or an explicit `undefined` value is passed.
488490

0 commit comments

Comments
 (0)