Skip to content

Add better type hints to generics defineComponent #9912

Closed
@aibayanyu20

Description

@aibayanyu20

Vue version

3.3.13

Link to minimal reproduction

#7963

Steps to reproduce

  • Use defineComponent to write vue components
  • The first parameter uses functional programming
  • Compile using vue-tsc

What is expected?

Unable to support type hints for slots, events and generics

What is actually happening?

Hope to support slots, events and generic type hints
The final compiled type is:

(props:Type) => any

There is no way to provide corresponding prompts when using it in vue.

Or is there a better way to support it?

System Info

No response

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