我有一个基本的通用应用程序创建与Nuxt。
我是全新的vue和nuxt,Im试图理解路由是如何工作的,更确切地说,嵌套路由是如何工作的。
所以我的项目结构是
├── parent
│ ├── child1.vue
│ └── child2.vue
├── parent.vue在父页面中,我有两个child1和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>
我的目标是当我点击链接进入下一页,例如/parent/child2,
但这种事不会发生。当我单击链接时,它会重新打开同一个父页面。
发布于 2018-10-08 23:34:46
将文件parent.vue移动到parent/index.vue
发布于 2021-02-23 18:57:04
只是一个小小的提示,您也可以为您的孩子使用parent/_slug.vue。
https://stackoverflow.com/questions/52711101
复制相似问题