A
A
adizh2022-02-10 08:23:54
Vue.js
adizh, 2022-02-10 08:23:54

How to properly nest routes in Vue2?

What is the right way to do nested childrent routes? The route navigates, but does not open the page (remains on the parent ). These nested routes worked until the children array was added (when they were separate
routes):

{
      path: "/pokemon", name: "pokemon", component: pokemon,
      children:[
        { path: ":name", name: 'name', component: pokemonDetail, props: true },
        { path: "type/:typeName", name: 'types', component: TypeDetail, props: true }
      ],
      props: true,
      meta: {
        requireAuth: true
      }
    },


go to these pages:
<router-link
      id="info"
      class="btn btn-warning link_to"
      :to="{name: 'name', params: { name: pokData.name } }"
      >Info</router-link
    >

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WapSter, 2022-02-10
@wapster92

Missing router-viewin parent component

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question