I want to use my router.js, so i installed @nuxtjs/router
.
Problem router-view child1 and child2 do not show when clicking on nuxt-link.
Steps to Reproduce
Go to http:/localhost:8080/test/childtest directly from the browser, router-view child1 and child2 will display on the screen.
However, when i go to http:/localhost:8080/test first, and click on the <nuxt-link to="/test/childtest">childtest</nuxt-link>
, the page remain unchanged. child1 and child2 do not show.
child1.vue and child2.vue
<template>
<div>
Child1/2
</div>
</template>
test.vue
<template>
<section class="container">
<div>
<h2 class="subtitle">
<div><nuxt-link to="/test/childtest">childtest</nuxt-link></div>
<div><nuxt-link :to="{name: 'childtest'}">namedchild</nuxt-link></div>
<router-view></router-view>
<router-view name="child1"></router-view>
<router-view name="child2"></router-view>
</h2>
</div>
</section>
</template>
routes: [
{
path: "/test",
component: Test,
name: "test",
children:[
{
name: 'childtest',
path: "childtest",
components: {
child1: Child1,
child2: Child2
}
}
]
}
]
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2327">#c2327</a>)</em></sub></div>