I have a F7 V5 cordova app set up with routable tabs as views using components in my router. 3 tabs. Main, Events, Join.
After initially loading the app, if I console.log( app.views) I can see all these views in the object. See below for output.
I have a button in the main view that has a click handler which is supposed to route the user to the Events tab/view with the following method: app.views.eventsView.router.navigate( {name:‘eventPage’, params: { eventID: ‘20S113’} });
router component looks like:
{
path: ‘/events/:eventID?’,
name: ‘eventPage’,
component: EventsPage,
…
}
However, this does not appear to work. I thought that if the view is initialized this navigation method would work.
Ironically, when I change the button click to do app.views.mainView.router.navigate( {name:‘eventPage’, params: { eventID: ‘20S113’} }); (note mainView ) it does work, but then selecting the home/mainview TAB does not work.
I’m sure there’s a logical explanation, but I just can’t figure it out. Any advice is greatly appreciated.
app.views;
-
(3) [View, View, View, current: (…), main: View, mainView: View, create: ƒ, get: ƒ, …]
-
current: (…)
-
0: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
1: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
2: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
create: ƒ create(el, params)
-
get: ƒ (viewEl)
-
main: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
mainView: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
eventsView: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
joinView: View {eventsParents: Array(1), eventsListeners: {…}, params: {…}, routes: Array(10), app: Framework7, …}
-
length: 3
-
get current: ƒ ()
-
proto: Array(0)
Thank you.
Paul