Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type error of defineComponent's second generic param related to EmitsOptions #12673

Open
LoTwT opened this issue Jan 9, 2025 · 0 comments · May be fixed by #12676
Open

type error of defineComponent's second generic param related to EmitsOptions #12673

LoTwT opened this issue Jan 9, 2025 · 0 comments · May be fixed by #12676

Comments

@LoTwT
Copy link

LoTwT commented Jan 9, 2025

Vue version

latest ( 3.5.13 )

Link to minimal reproduction

https://play.vuejs.org/#eNp9UsFq3DAQ/ZWpLnbAsUnT0+I1tCXQ9tCWttBD1YOxZzdKbElII8dg/O8ZyewmhJCTPfPeG72n0SI+WltOAcVO1L5zyhJ4pGAbqdVojSNYwOEBVjg4M0LG1ExqqTujPcHoj7CPeJ59wWEw8Ne4oX+XXUhdV9s4HsQF4WiHlpArgPr2qlmWJF7XuuIqdZW2gWC6HE2Pw14KxqWAisG6eqYXhSDPxx/UsbzzRrPzJeql6Mxo1YDuhyXF9qTYQUIi1rK7h2+pRy5gcep3t9jdv9K/83PsSfHToUc3oRRnjFp3RNrgm9/fceb/M8juw8DsN8Bf6M0QoseN9inonm0/4yW3X9P9K338429mQu1PoaLRyFwTXwreyec3oj/ZvS4/JJ3UK99i1JTkZ77A86p7PCidphmNmk5rT2dI8bT4yODNv6DXy1rwkGB7XtUO/k3tEPjryXGK/7A2eW6dsb6AjuYL2DebSS5KHBXl2abMCsiu3l/HV/QqyNgLSBt9ibPytGkcv2CnIU9H1L2aGpbUVfzh6EyRGueUmAO0YdjyiPURLLgDZg==

Steps to reproduce

  • open the reproduction link
  • check the Comp.tsx

What is expected?

pass the type check of EmitOptions with the named tuple syntax

What is actually happening?

  • type error when using named tuple syntax
  • ctx.emit has corresponding types and type safe
image

System Info

No response

Any additional comments?

refer to Type-only props/emit declarations

The named tuple syntax can work, but the function syntax can't. Should they all be supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants