Skip to content

defineComponent (function syntax): optional props inferred as requiredΒ #13964

@zfeher

Description

@zfeher

Vue version

3.5.22

Link to minimal reproduction

minimal repro

Steps to reproduce

1, open minimal repo and see the reported error in App.vue at <Comp> usage. It says p1, p2 and p3 required props are missing.

2, open Comp.ts see Comp definition where p1, p2 and p3 are defined as optional props. Hoovering over props in setup func also shows them incorrectly as required.

What is expected?

p1, p2 and p3 props of Comp correctly inferred as optional props like what happens with the similar CompB (options syntax).

What is actually happening?

p1, p2, and p3 props of Comp are inferred incorrectly as required props.

System Info

Any additional comments?

No response

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