Skip to content

Boolean props default value is not undefined #5863

@beruic

Description

@beruic

Version

3.2.31

Reproduction link

sfc.vuejs.org/

Steps to reproduce

See the minimal reproduction.

What is expected?

Both myValue and myOtherValue should be undefined by default.

What is actually happening?

myOtherValue (where only the type constructor is defined) ends up false instead.


That a Boolean ends up false by default kinda makes sense, but is also inconsistent with the documentation. All the types should all behave predictably for consistency, so either the documentation needs to specify this, or it has to be changed.

The documentation states that "An absent optional prop will have undefined value" at https://vuejs.org/guide/components/props.html#prop-validation (A bit down under "Additional details:")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions