vue.js - 动态嵌套路由 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>
我正在阅读文档,但无法实现最终目标
解决方案
解决方案是简单地上一层:
image
|
| _slug
| annotation
| _id.vue
| _slug.vue
推荐阅读
- angular - 如何对来自activatedRoute的oninit数据是否可用进行单元测试
- oracle - Kotlin 暴露框架
- swift - SceneKit 中的透明 NSHostingController
- android - Android 应用内购买:是否可以通过云功能验证收据而不将收据信息存储在数据库中?
- sql - 从事实表中删除重复项以正确计算度量
- python - 如何加快 Excel 电子表格的创建速度。目前它使用openpyxl逐个单元格
- xml - 使用所有必需的枚举进行 XSD 验证
- r - 基于另一列创建列但不按字母顺序匹配
- java - 使用 XRay AWS 跟踪 Java 应用程序时找不到段?
- python - Pandas 列 dtype 是对象,但 python 认为它是浮点数