I’m building an app with inline (stacked) pages and having an issue with the router.
Link navigation is fine: <a href="/page1/">
and <a href="/page2/">
both work with no issues.
However, router-based navigation works on one of my pages, but not the other: app.router.navigate('/page1/')
is fine, but when I call app.router.navigate('/page2/')
, I get the following error: Uncaught TypeError: Cannot read property ‘f7Page’ of undefined | framework7.js:5589
framework7.js:5589 has if ($newNavbarInner.length === 0 && $newPage[0].f7Page)
Somehow, in my case, $newPage[0]
is undefined.
My routes are all defined at the app level:
app = new Framework7({
id: 'com.app.mobile',
name:'My App',
routes: [
{
path: '/page1/',
pageName: 'page1',
},
{
path: '/page2/',
pageName: 'page2',
},
],
});
Page 1 is stacked inside my main view. Page 2 is stacked inside a different view, but I get the error even when that view is active. Both views have {stackPages:true}
Help!