Skip to content
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

Routing issue #231

Closed
bonomite opened this issue Jan 30, 2023 · 2 comments · Fixed by #431
Closed

Routing issue #231

bonomite opened this issue Jan 30, 2023 · 2 comments · Fixed by #431
Assignees
Labels
bug Something isn't working

Comments

@bonomite
Copy link

bonomite commented Jan 30, 2023

🐛 The bug

Can anyone tell me what I am doing wrong with routing?!?! I have a Nuxt3/Capacitor project, and I just want to navigate to a page. nuxt-link just makes the new page appear under the home page. When I add the and tags in the page, the pages don't render.... until I remove the app.vue. Then everything works as expected.... but the default.vue template is no longer rendering again.... which was part of a previous bug @danielroe helped me with.

There HAS to be a magical combination where I can get the routing working with the default.vue template. I can't figure it out.

🛠️ To reproduce

routing broken with default.vue template:
https://stackblitz.com/edit/nuxt-starter-4c373a?file=package.json,nuxt.config.ts,pages%2Findex.vue,pages%2Fnew-page.vue

routing working, without default.vue template:
https://stackblitz.com/edit/nuxt-starter-6z9yld?file=temp_app.vue,pages%2Findex.vue,pages%2Fnew-page.vue

🌈 Expected behaviour

Using a nuxt-link component, navigate to(), or router.push() should just route to the desired page as normal.

ℹ️ Additional context

No response

@bonomite bonomite added the bug Something isn't working label Jan 30, 2023
@bonomite
Copy link
Author

after another day of playing around... it seems like having this as my app.vue file seems to be working.
<template> <ion-app> <NuxtLayout> <NuxtPage /> </NuxtLayout> </ion-app> </template>

@alex-steinberg
Copy link

alex-steinberg commented May 1, 2023

@bonomite check out the docs 👇

you should avoid using <NuxtPage> or <NuxtLayout>

I've found router.push to navigate OK but not preserve params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants