router-extras-module icon indicating copy to clipboard operation
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

Open CodyBontecou opened this issue 2 years ago • 1 comments

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?

CodyBontecou avatar Aug 06 '21 23:08 CodyBontecou

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>

farnabaz avatar Sep 09 '21 17:09 farnabaz