首页 > 解决方案 > 动态嵌套路由 nuxt

问题描述

我正在尝试在 nuxt 中创建以下结构

image/:slug:用户可以看到图像视图

image/:slug/annotation/:comment-id:用户可以在背景上看到图像,但也会出现一个带有评论的弹出窗口

我有以下文件夹结构:

image
|
| _slug
|  annotation
|    _id.vue
|  index.vue

index.vue

<template>
  <section>
    <image-annotation
      :image="activeImage"
      :annotations="activeImageAnnotations"
    />

    <v-divider />
    <title-row />

    <nuxt-child />
  </section>
</template>

我正在阅读文档,但无法实现最终目标

标签: vue.jsnuxt.js

解决方案


解决方案是简单地上一层:

image
|
|  _slug
|    annotation
|      _id.vue
|  _slug.vue

推荐阅读