Closed vzakharov closed 2 months ago
Overall, I’d say this package needs a more detailed documentation to be usable, although I’m grateful the possibility exists at all.
Okay, after adding the route manually where it should have been auto-generated:
I get correct type inference:
So my problem is typed-routes.d.ts not auto-generating correctly. I wonder if I’m doing anything wrong in router.ts
? Should I define the routes by some other way altogether? definePage
or something? I’d really prefer to keep my routes defined in one place.
Okay, after finally solving #323, I ran into this:
and this:
I don’t know if it’s because I’m importing incorrectly (the docs do not make it clear on how to actually use the typed routes, not just define them, and the StackBlitz demo seems to be just a boilerplate Vue 3 app with nothing reminiscent of routes), but importing from simply
vue-router
results in the usual routes, while importing from@vue-router
as suggested in the very first screenshot in the readme leads to "cannot find module".My
typed-router.d.ts
looks also boilerplate:Here is my
src/router.ts
for reference: