Skip to content

Commit

Permalink
Correct default value for absent props.The Boolean missing prop will …
Browse files Browse the repository at this point in the history
…cast to false instead of undefined, vuejs/core#5863 (comment) (#536) (#537)

* fix: update named slots diagram

Close #1688

* Correct default value for absent props. (#1705)

The Boolean missing prop will cast to false instead of undefined, vuejs/core#5863 (comment)

Co-authored-by: Natalia Tepluhina <tarya.se@gmail.com>
Co-authored-by: sondh0127 <62163604+sondh0127@users.noreply.github.com>
  • Loading branch information
3 people authored May 9, 2022
1 parent fb64675 commit e3c14fb
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 e3c14fb

Please sign in to comment.