-
Couldn't load subscription status.
- Fork 13.4k
Allow ion-tab to work with router-view #24971
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
Conversation
|
@liamdebeasi hey sorry to open this again but i was hit again by this issue while building https://github.com/Cap-go/capgo |
|
@riderx can you share what issue exists in the Ionic Vue Router that prevents you from using it? I can let the other team members weigh in here, but we do not want to encourage developers to be able to eject from our implementations to mend other solutions in place. We have this stance for multiple reasons:
|
|
Hey @sean-perkins thanks for the answer. The main issue who stop me using ionic-router is sub routing. You can check the code here https://github.com/Cap-go/capgo I totally understand the the fact that will degrade the experience that why i put the warning. |
|
@riderx after discussing with the team further, the problem you are experiencing is a result of how you are autogenerating routes based on the file structure: https://github.com/Cap-go/capgo/blob/main/src/main.ts#L6 You should not be generating sibling pages in tabs as children. Instead they should be siblings. For example:
There should not be a This is explain in the docs: https://ionicframework.com/docs/vue/navigation#shared-urls-versus-nested-routes I am going to close out this PR, as this is not a change we are wanting to support. Feel free to open an issue if you run into problems when following that documentation and we can help assist. Thanks! |
|
Understand your feedback, but please understand mine. What i do now to have SSG/SSR working ( in Captime app ) is: This doesn't make really sense for me to have to do that, even i understand what you think, you have to consider usages. I can't have both working together as you can see in Capgo, i have no SSG implementation otherwise, so no Meta, no SEO ... My last option is to totally stop to using ionic and switch to Quasar who is really made for Vue users. |
|
@riderx I am unfamiliar to Vitesse. Does it prevent you from adjusting the declaration pattern for routes that are registered to Ionic Vue's router? The issue you describe:
Is a supported feature of our router integration. You will just need to adjust the way that routes are declared to take full advantage of it. By refactoring your route definitions from being nested, to siblings, you should be able to have the navigation pattern you desire with tabs, without using |
|
@sean-perkins yes vitesse create the routing automaticly from folder architechture and handle the SSR/SSG system for you for SEO purpose. |
|
@riderx is there any time commitments/deadlines you are up against with this request? I see the pain points you are facing and have also briefly looked into what other libraries do to see if our approach is too restrictive. I would like to draft an internal feature proposal with the team and review it, before proceeding with this request. While I can see the benefit of supporting alternative router outlets for web-desktop implementations using Ionic, I also believe tabs should potentially not require a router outlet at all. If I can de-risk this approach internally, it would likely lead to removing the opinionated errors we throw and allow you to integrate as you please. Ionic would obviously not support custom 3rd party solutions, but we would also not prevent you from experimenting with them as well. |
|
@sean-perkins i use ionic since years and would love to continue using it! What you propose is perfectly what i expect, allow a bit of flexibility for usage . |
|
Just saw today the maintainer of vitesse ask about how people do animations between components or page in vue. |
|
The animation pattern demonstrated in that tweet is both a very different feature and implementation pattern than what Ionic Framework does for page transitions. Ionic maintains the previous view in the DOM, so that we can animate a swipe-to-go-back experience correctly, without screen jittering from having to render the previous view (it is already rendered, just off screen). This aligns with native app page transitions. The tweet demonstrates cloning element nodes and then transitioning that cloned node into a new page. You can technically already do this with Ionic or any web solution. It just requires complexities of knowing the start and end position of your transitions and re-attaching event listeners, which is why it is extremely unlikely Ionic would solve that problem for you, as it is an application detail. You could this without cloning the node, but it wouldn't be as smooth of an experience, i.e. I did it previously with Ionic v4: https://twitter.com/seanfperkins/status/1136502546577723397. |
|
@sean-perkins thanks for the mind-blowing moment, now i understand a lot better! i didn't understand you modified the Vue router to have kept the view in the DOM, i saw the init function where never call again but couldn't explain why. This should be explained in this page: https://ionicframework.com/docs/vue/navigation That will solve a lot of unnecessary fight with ionic router! |
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build) was run locally and any changes were pushednpm run lint) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
i don't use ion-vue-router in my project, but i cannot use ion-tab without it, instead of hacking routing it made possible to use it without.
The only change is there are no animation any more.
To work the
Issue Number: 24192
What is the new behavior?
Does this introduce a breaking change?
Other information