我在Nuxt中具有以下目录结构:
myProjectRoot/
--| pages/
----| products/
------| _id.vue
----| collections/
------| _id.vue
------| index.vue
----| collections.vue
该结构分别为我提供了以下匹配项:
[u1] localhost/collections --> [c1] pages/collections.vue
[u2] localhost/collections/10 --> [c2] pages/collections/_id.vue
[u3] localhost/products/100 --> [c3] pages/products/_id.vue
现在,我想在[c3]
上将[c1]
组件显示为子视图(与[c2]
相同),但保留与[u3]
相同的url。我该怎么办?