@
@
@estluced2021-04-11 22:27:56
Vue.js
@estluced, 2021-04-11 22:27:56

How does passing parameters to the start router work?

Hello!
For half an hour now I can not find information on this matter (I do not rule out that I googled badly).
In general, let's immediately throw off the code:

{
  path:'/',
  name:'Main',
  children:[
    {
      path:'',
      component:main
    },
    {
      path:':login',
      name:'User',
      component:user,
      props:true,
    },
  ]
},


Everything is clear here, I want to link user navigation to the start router, so that it looks something like this:
example.com/admin
And of course, so that the start router also serves as the main page.
But I can’t find any information about this, and I can’t even understand how it should work, I’m thinking to check whether there are parameters there for the start router component, if there are then show the user’s page, if not, then the main page, but this method sounds not really ...

How to solve this issue?
Many thanks in advance for your replies!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
low molecular macro, 2021-04-12
_

{ path: "/", component:main },
{ path: "/:login", component:user }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question