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

@vuedx/typecheck v-slot typings #83

Closed
cexbrayat opened this issue Nov 26, 2020 · 4 comments
Closed

@vuedx/typecheck v-slot typings #83

cexbrayat opened this issue Nov 26, 2020 · 4 comments
Labels
blocked Blocked on some dependency Stale

Comments

@cexbrayat
Copy link

When using v-slot, for example with RouterView, vudex-typecheck throws:

=> ./src/App.vue:4:27
Error :: Binding element 'Component' implicitly has an 'any' type. (code 7031)
   2 |   <Navbar />
   3 |   <div class="container" style="margin-top: 70px">
   4 |     <RouterView v-slot="{ Component }">

This obvious fix is to disable noImplicitAny, but I was wondering if it was possible to do better?

@znck
Copy link
Collaborator

znck commented Nov 27, 2020

Related RFC: vuejs/rfcs#192

@znck znck added the blocked Blocked on some dependency label Nov 27, 2020
@simon04
Copy link
Contributor

simon04 commented Feb 9, 2021

Vetur fixed tracked this issue vuejs/vetur#2258 and silenced the error in the PR vuejs/vetur#2259.

@cyrus1996
Copy link

cyrus1996 commented Feb 25, 2022

Hello for future reader try :

<RouterView v-slot="{ Component }: { Component: Object }">

This should do the trick, for perfectionnists I think the original value in of VNode instance

@znck
Copy link
Collaborator

znck commented Feb 27, 2022

Fixed in 7d1d193. Try pre-release build.

@vuedx vuedx locked and limited conversation to collaborators Feb 27, 2022
@znck znck added the Stale label Apr 10, 2022
@znck znck closed this as completed Oct 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Blocked on some dependency Stale
Projects
None yet
Development

No branches or pull requests

4 participants