【问题标题】:Dynamic Nested Routes nuxt动态嵌套路由 nuxt
【发布时间】:2021-01-20 15:46:38
【问题描述】:

我正在尝试在 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>

我正在阅读docs,但我无法实现我的最终目标

【问题讨论】:

    标签: vue.js nuxt.js


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2020-08-11
      • 2019-03-13
      • 1970-01-01
      • 2021-03-14
      • 1970-01-01
      • 2020-09-22
      • 2021-06-02
      • 1970-01-01
      • 2014-07-05
      相关资源
      最近更新 更多