vue-route-generator icon indicating copy to clipboard operation
vue-route-generator copied to clipboard

Support for unknown dynamic route

Open nonsocode opened this issue 4 years ago • 2 comments

There's currently no support for a 'Catch all' route similar to what's available as seen in Nuxt

It'll be nice to add support for _.vue files to be a catchall route.

pages/
--| people/
-----| _id.vue
-----| index.vue
--| _.vue
--| index.vue

nonsocode avatar Jun 07 '20 22:06 nonsocode

Sounds like we should implement it in this lib as well. btw, you can do that by just passing normal vue-router config in the current version.

import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'

Vue.use(Router)

export default new Router({
  routes: [
    ...routes,
    
    {
      path: '*',
      redirect: '...'
    }
  ]
})

ktsn avatar Jul 11 '20 14:07 ktsn

@ktsn Agreed. But the underscore notation allows for more consistency with the convention and would be very useful for nested routes

nonsocode avatar Jul 19 '20 08:07 nonsocode