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

[Bug] prop being passed but volar throws that it wasn't #2468

Closed
wenfangdu opened this issue Feb 28, 2023 · 5 comments · Fixed by #3147
Closed

[Bug] prop being passed but volar throws that it wasn't #2468

wenfangdu opened this issue Feb 28, 2023 · 5 comments · Fixed by #3147
Labels
bug Something isn't working

Comments

@wenfangdu
Copy link
Contributor

image
image
image

Repro Link

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Mar 10, 2023
@wenfangdu
Copy link
Contributor Author

@johnsoncodehk Still reproducible in Volar v1.3.4:

image

What's worse is that the inline prop-missing hint is gone, before:

image

Now:

image

Please reopen this.

@johnsoncodehk
Copy link
Member

This is by design, please try:

defineProps<{
	msg: string
-	onEvent(): void
+	onEvent?(): void
}>()

@wenfangdu
Copy link
Contributor Author

@johnsoncodehk But onEvent is indeed passed:
image

This is by design

So there's no way to make onEventListeners required?
Also, by Vue's design or by Volar's? If it's by Volar's design and not by Vue's, then it's still a bug.

@wenfangdu
Copy link
Contributor Author

@johnsoncodehk Vue clearly allows making onEventListeners required:
image
Please reopen this issue 🙏.

@wenfangdu
Copy link
Contributor Author

@johnsoncodehk Thanks, passing onEvent satisfies Volar now:
image
However, the inline error hint for missing msg like the below one is gone, can we add it back?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants