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

defineProps generates unnecessary array of same types #4352

Closed
hkk12369 opened this issue Aug 16, 2021 · 0 comments · Fixed by #4353
Closed

defineProps generates unnecessary array of same types #4352

hkk12369 opened this issue Aug 16, 2021 · 0 comments · Fixed by #4353
Labels

Comments

@hkk12369
Copy link
Contributor

hkk12369 commented Aug 16, 2021

Version

3.2.2

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuXHQ8ZGl2IDpjbGFzcz1cImBkZXB0aC0ke2RlcHRofWBcIj5cbiAgICA8c2xvdCAvPlxuICA8L2Rpdj5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQgc2V0dXAgbGFuZz1cInRzXCI+XG5kZWZpbmVQcm9wczx7XG5cdGRlcHRoPzogMSB8IDIgfCAzIHwgNCB8IDUsXG59PigpO1xuPC9zY3JpcHQ+XG4ifQ==

Steps to reproduce

Use any prop with multiple values of same type. eg.

defineProps<{
	depth?: 1 | 2 | 3 | 4 | 5,
}>();

What is expected?

depth should have type Number

What is actually happening?

depth has type [Number, Number, Number, Number, Number]

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

Successfully merging a pull request may close this issue.

3 participants
@hkk12369 @posva and others