0
export default new Router({
  routes: [
    {
      path: '/:userId',
      name: 'top',
      component: Top
    }
  ]
})

I cannot give a query param like this.

Is it impossible to give param to root view?

export default new Router({
      routes: [
        {
          path: '/top/:userId',
          name: 'top',
          component: Top
        }
      ]
    })

I know this is possible , but I want to give param to root page.

1 Answer 1

1

You can try :

export default new Router({
  routes: [
    {
      path: '/',
      component: Root,
      children: [
      {
        path: ':userId',
        name: 'top',
        component: Top
      }
    }
  ]
})
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.