【发布时间】:2019-09-18 21:12:03
【问题描述】:
我正在使用 Nuxt 子组件,但也想更深地链接到子组件。
我认为这最能说明问题。
example.com/cars <-- cars.vue (has nuxt-child)
example.com/cars/bmw/ <-- cars/_maker.vue (this is the child)
example.com/cars/ford/ <-- cars/_maker.vue (this is the child)
example.com/cars/bmw/i3 <-- cars/_maker/type.vue (shows wrong template)
example.com/cars/ford/mustang <-- cars/_maker/type.vue (shows wrong template)
_type.vue 未呈现,而是使用_maker.vue 模板。
我没有设置扩展路由,它完全脱离了目录结构路由。
如何让/i3 和/mustang 路由使用type.vue 模板?
我认为我可以通过不使用 Nuxt-Child 并执行类似的操作来做到这一点,但我失去了良好的 Nuxt-Child 行为。
example.com/cars <-- cars/index.vue
example.com/cars/bmw/ <-- cars/_maker/index.vue
example.com/cars/bmw/i3 <-- cars/_maker/_type.vue
【问题讨论】:
-
请尝试:cars/_maker/_type/index.vue
标签: vue.js routing vue-router nuxt.js