Typescript definition for 'useRoute' differs https://router.vuejs.org/api/#useRoute and https://router.vuejs-korea.org/api/#useroute #2281
Replies: 3 comments 1 reply
-
You will have to tell them on their repository to update it: https://github.com/niceplugin/Vuejs-Router-KO |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'll do it.
But how could I get the params from the one that comes with the library?
Should I cast to a different type?
…On Fri, 21 Jun 2024, 16:11 Eduardo San Martin Morote, < ***@***.***> wrote:
You will have to tell them on their repository to update it:
https://github.com/niceplugin/Vuejs-Router-KO
—
Reply to this email directly, view it on GitHub
<#2281 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXPQCGWIKN34WDAZCHZY7DZIQYCVAVCNFSM6AAAAABJVNTXQKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNBQGUZTK>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Then the corrected version of the definition doesn't match with what I get
when I go in the console and check the object content. This I mean.
I could use the params attribute, but the IDE shows an annoying error that
the attribute doesn't exist. The only way to get rid of it's to cast the
results to a different type, but it's intrinsically wrong. Moreover when
the online documents (as here
https://router.vuejs.org/guide/advanced/composition-api) shows that the
object returned by useRoute has the attribute.
…On Fri, 21 Jun 2024, 17:28 Eduardo San Martin Morote, < ***@***.***> wrote:
I don’t understand
—
Reply to this email directly, view it on GitHub
<#2281 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEXPQCC6NV2UF3FSWEOFIB3ZIRBDRAVCNFSM6AAAAABJVNTXQKVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TQNBRGI4TA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm finding some difficulties to get rid of some annoying errors with Typescript.
We access the
params
of a route within thesetup
code of a component. But the actual definition ofuseRoute
is:export function useRoute(): RouteLocationNormalizedLoaded
That means, using typescript I get an error when I write
useRoute().params
due to the fact that the returned type doesn't have that property. But the object actually carries this information, because going in debug the attribute is there.Then, looking around for a way to solve the problem, I've found that the definition of the function on vuejs-korea differs from the one defined by vuejs. There
useRoute
returns the typeRouteLocationNormalized
, that looks the correct definition instead the one that returnsRouteLocationNormalizedLoaded
.Could someone verify and eventually fix it?
Beta Was this translation helpful? Give feedback.
All reactions