-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use a same component for two or multiple routes / pages? #2693
Comments
Check out this example https://github.com/nuxt/nuxt.js/tree/dev/examples/i18n/pages |
Hi @DreaMinder, <!-- ~/pages/signin -->
<script>
import Signup from '~/pages/signup'
export default Signup
</script> But the problem is the page will rerender when changing between these pages, making the animations useless (and losing states). |
One of the ways to handle this is to use nested routes, that way you could control the animation by wrapping the |
Same issue here and I think the For example we have an I don't see how this is easily possible right now with keeping animations working. Maybe there should be a "pages aliases" feature in |
@pschaub , I agree. If you already have a project migrating to VueJS there will be many pages whose url structure could have changed but would be linking as alternate links and still preserve SEO, then you should you have the ability to add alias then? I believe this is a very valid case. I'm facing this issue and don't know how to solve this |
I was able to achieve this with declaring another path in extendRoutes instead of using
I hope this i will be useful to others. |
You can use |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I wanted to use the same component for both
/signup
and/signin
route.The reason is because the component looks something like this pen, and I would like when the use clicks signin or signup, the url changes to
/signin
and/signup
accordingly, with the transition animation.How can I do this with nuxt? It would be awesome to achieve this without the router-module, am I missing something?
The text was updated successfully, but these errors were encountered: