Hi everyone,
I got a Problem with my routing. My App routing flow looks like this:
Page 1 → Page 2 → Tabs Page → Page 3
It is a sports App. The user can enter on Pages 1 and 2 some details an in the tabs page the scores for each round. There are 5 rounds, each in one tab. After entering the scores for each player the app navigates to an overview page 3. When routing to Page 3 the URL changes but not the content of the page. The computed methods in my setup of the composition api implementation are also called. Unfortunately this is not always the case. When i navigate from round 1 to 5 and then to page 3 without entering scores the navigation work correctly.
I am using firebase to store the scores in a realtime database. The id from the firebase collection is part of the url and passed to each page. The 5 rounds in the tabs page are also dynamic with an round id so the path looks like this: karting/championship/myidfromfirebase/lap/3 for the tab of the 3rd lap.
I recognized when I switch from tab 1 to tab 2 the lifecycle hooks “page will leave” and “page will enter” of the child page (laps) for the round are called two time each. I dont know if this is another error or it leads to the router error. The Tabs parent page “will leave” is called after the setup of page 3
Here is my router:
{
path: '/karting/championship/start',
name: 'championshipStart',
component: () => import('../views/championshipStart.vue'),
},
{
path: '/karting/championship/:KKid/drivers',
name: 'championshipDrivers',
component: () => import('../views/championshipDrivers.vue')
},
{
path: '/karting/championship/:KKid/laps',
name: 'championshipLaps',
component: () => import('../views/championshipLaps.vue'),
children:[
{
path: ':lap',
name: 'LapPage',
component: () => import('../views/LapPage.vue')
}
]
},
{
path: '/karting/championship/:KKid/zusammenfassung',
name: 'championshipZusammenfassung',
component: championshipZusammenfassung
},
and my tab bar
<ion-tabs>
<ion-router-outlet></ion-router-outlet>
<ion-tab-bar slot="bottom">
<ion-tab-button tab="lap1" v-bind:href="'/karting/championship/' + aktivesKKId + '/laps/1'">
<ion-label class="lapLabel">1</ion-label>
</ion-tab-button>
<ion-tab-button tab="lap2" v-bind:href="'/karting/championship/' + aktivesKKId + '/laps/2'">
<ion-label class="lapLabel">2</ion-label>
</ion-tab-button>
<ion-tab-button tab="lap3" v-bind:href="'/karting/championship/' + aktivesKKId + '/laps/3'">
<ion-label class="lapLabel">3</ion-label>
</ion-tab-button>
<ion-tab-button tab="lap4" v-bind:href="'/karting/championship/' + aktivesKKId + '/laps/4'">
<ion-label class="lapLabel">4</ion-label>
</ion-tab-button>
<ion-tab-button tab="lap5" v-bind:href="'/karting/championship/' + aktivesKKId + '/laps/5'">
<ion-label class="lapLabel">5</ion-label>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
I navigate to Page 3 like that
const navigateTozusammenfassung= (async() =>{
router.navigate('/karting/championship/' + aktivesKKid.value + '/zusammenfassung','forward')
})
Does anyone know why the page is not rendering? Thanks