3 ms·
We use Nuxt on a fairly large project. One of the biggest problems we’re having is that there’s no routes file you define yourself, you structure it by putting
by thomasedwards 6y ago
We use Nuxt on a fairly large project. One of the biggest problems we’re having is that there’s no routes file you define yourself, you structure it by putting views in folders. This is a nightmare once you have more than a few models. It also leads to highly confusing page names, and if you have more than one variable in a route, completely screws everything up. We’ve ended up grouping things together in folders just to make it easier to manage, but that directly effects the URL.
- avolcano 6y agoDoes extendRoutes (https://nuxtjs.org/api/configuration-router#extendroutes https://nuxtjs.org/api/configuration-router#extendroutes) not work for y'all? I haven't had to use it (yet) but I was happy to see an escape hatch, though I could imagine it not scaling very well...
- thomasedwards 6y agoMy understanding was that it just added to the existing generated list, I can’t work out how you’d tell it to ignore all your current pages and then manually write them all out?
- freneticks 6y agoyou can use router-module if you want to do everything yourself (https://github.com/nuxt-community/router-module https://github.com/nuxt-community/router-module)
- thomasedwards 6y agoAh that’s perfect, I don’t know why I haven’t found it before. Thanks.
- buremba 6y agoThat's the main point of Nuxt. You look at the URL and find the page component without going through the routes file. In case that doesn't work for you, you can use `extendRoutes` for dynamic use-cases.