Type issue when initializing a ref()
with an object that includes router types
#2373
Unanswered
JammingBen
asked this question in
Help and Questions
Replies: 1 comment 1 reply
-
You should pass the type param to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently facing an issue where TS complains about incorrect types when initializing a
ref()
with an object that includes a property of typeRouteLocation
.The code looks something like this:
Now TS is complaining that
foo
isn't assignable to the typeFooType
. It seems to come down to this issue:Types of property 'path' are incompatible. Type 'unknown' is not assignable to type 'undefined'
.Also, I only encounter this error with
vue-router
versions >=4.3.0
. Anyone got an idea why this is happening?Reproduction: Vue SFC Playground (see
app.vue
file)Beta Was this translation helpful? Give feedback.
All reactions