M
M
myskypesla2018-04-21 21:37:26
Vue.js
myskypesla, 2018-04-21 21:37:26

How to make an alias in Vue.js?

There are 2 pages:
index (path '/')
faq (path '/faq')
Also, users have links on hand, and about 30,000 pieces.
I need to make sure that when a user visits a page, let's say https://domen.ru/21095 , the index page is displayed to him, and the path is like this https://domen.ru/21095.
If I do this in the router/index.js file:

{
      path: '**',
      name: 'index',
      component: index,
    },

then the following warning appears in the console prntscr.com/j8bjoh
UPD: name should have been removed

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kulakov, 2018-04-22
@myskypesla

If you just write like this:

{
      path: '/',
      component: index,
      children: [
        {
          path: ':id'
        }
      ]
}

or like this:
{path: '/', сomponent: index},
{path: '/:id', сomponent: index}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question