简体   繁体   中英

Nuxt nested routes

Im having a basic universal app created with Nuxt.

Im new with vue and nuxt and im trying to understand how routing works, to be more specific how nested routes works.

So my projects structure is

├── parent
│   ├── child1.vue
│   └── child2.vue
├── parent.vue

and in the parent page i have two links for child1 and child2

 <template> <div> <h3>Parent page</h3> <nuxt-link to="/parent/child1"> about1 page</nuxt-link> <nuxt-link to="/parent/child2"> about2 page</nuxt-link> </div> </template>

My goal is when i click on the links to go to next page for example /parent/child2 ,

but that doesn't happens. When i click on the links it reopens the same parent page.

将文件parent.vue移动到parent/index.vue

只是一个小提示,您也可以为您的孩子使用parent/_slug.vue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM