简体   繁体   English

Nuxt.Js 将父页面重定向到索引

[英]Nuxt.Js redirect parent page to index

I have pages folder structure as follow:我的页面文件夹结构如下:

--pages
  --projects
    --slug.vue
  --index.vue

When I go to the "/projects/something" URL it's work fine, but when I go to the "/project" URL I would like see (main page) index.vue. When I go to the "/projects/something" URL it's work fine, but when I go to the "/project" URL I would like see (main page) index.vue. How can I do that?我怎样才能做到这一点?

you should use like this way你应该这样使用

--pages
  --projects
    --_slug.vue
    --index.vue

hope it will sove the problem.希望它能解决问题。 you can read more from here你可以从这里阅读更多

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM