router-extras-module
router-extras-module copied to clipboard
I'd like to ignore the auto-generated route of the page I am using the router extras in
Say I have a page example.vue
with the following <router>
property:
<router>
alias:
- path: '/event/:id'
- path: '/:username/:eventName/:eventCount'
</router>
My generated router.js looks like:
{
path: '/example',
component: _4e18dbd1,
name: 'example',
},
{
path: '/event/:id',
component: _4e18dbd1,
name: 'example/event/:id',
},
{
path: '/:username/:eventName/:eventCount',
component: _4e18dbd1,
name: 'example/:username/:eventName/:eventCount',
},
Is it possible to remove the /example
route altogether? Or is the expected solution to this to create an example/event/_id.vue
file with the router logic placed in there?
Hey, Sorry for the late response
You can use path
option instead of alias to change the route itself
<router>
path: '/event/:id'
alias:
- path: '/:username/:eventName/:eventCount'
</router>