Skip to content

Commit

Permalink
Correct default value for absent props.
Browse files Browse the repository at this point in the history
The Boolean missing prop will cast to false instead of undefined, vuejs/core#5863 (comment)
  • Loading branch information
sondh0127 committed May 8, 2022
1 parent 8b584ee commit f127b68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/guide/components/props.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ Additional details:

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

- An absent optional prop will have `undefined` value.
- An absent optional prop other than `Boolean` will have `undefined` value.

- The `Boolean` absent props will be cast to `false`. You should set a `default` value for it in order to get desired behavior.

- 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.

Expand Down

0 comments on commit f127b68

Please sign in to comment.