nuxt-community / router-module

Nuxt 2 module to use router.js instead of pages/ directory.
MIT License
401 stars 28 forks source link

In production mode, only the first visit is valid #58

Closed LiuJiangshan closed 5 years ago

LiuJiangshan commented 5 years ago
This question is available on Nuxt community (#c44)
ghost commented 5 years ago

This issue as been imported as question since it does not respect router-module issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/router-module/issues/c44.

LiuJiangshan commented 5 years ago

I think I solved it. 屏幕快照 2019-09-10 下午3 52 00

connecteev commented 5 years ago

@LiuJiangshan 2 questions for you

  1. what was the issue and what was happening after the 1st visit?

  2. Also, why is this router-module needed? I think I read that Nuxt supports extendRoutes by default now -see https://nuxtjs.org/api/configuration-router/#extendroutes (though I haven't used it and don't understand it all that well). Can you clarify?

LiuJiangshan commented 5 years ago

@connecteev If you use the right part of the picture above, the second time you can't access it, it will always get stuck. This should be my problem. In addition, I will try extendRoutes, thank you.