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

Props type on component instance is weird when passing an empty object to the props field #8825

Closed
so1ve opened this issue Jul 21, 2023 · 2 comments · Fixed by #7419
Closed

Comments

@so1ve
Copy link
Member

so1ve commented Jul 21, 2023

Vue version

3.3.4

Link to minimal reproduction

https://play.vuejs.org/#eNp9UU1PAjEQ/SuTxgRMcDlwQzBRgwkelKg362FdZnFxd6ZpZ/nIZv+7bQlgCOHQpn3vzeubaaPujUlWNaqhGglWpkwF70b9w1H1lLiMKS8WydIxeV2jCUCrjCtTlGhfjRRMTqshRCZwaVny+jliYmvs7fHsB7PfM/jSbQKm1cyiQ7tCrQ6cpHaBsqMn7y+48ecDWfG8Lr36AvmGjss6ZNzJHmqa+9j/dDHttDJspaDFh5tsBMntmwpBg7KNeq38sB4vtH6MO0gGsU5T66eYJuL88Ir4DDQwx7yg6MSEJNBCbrna+Wt1q62msPzoncATM4xPS7pNFImxbJxP0Pag34fRDfi/ky1EGPh7iZkEYXt9YjoN2xgI18G/e6RlaxBmsXwM4cJ5FH92rqJp50u1fw6OvtI=

Steps to reproduce

Open the production link, goto a.ts, and hover on Props. You'll see it's type is weird.

image

What is expected?

It should be an empty object

What is actually happening?

It includes many array methods.

System Info

Irrelevant - we can reproduce it easily in vue playground and it's a type issue

Any additional comments?

vuejs/language-tools#3430

@scottbedard
Copy link
Contributor

On first glance, it looks like the array types may be coming from the string[] part of this union

export type ComponentPropsOptions<P = Data> =
| ComponentObjectPropsOptions<P>
| string[]

@yyx990803
Copy link
Member

Looks like this is fixed by #10801

@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants