Hey there,
I would like to ask for help upon a strange behavior on my router configuration. I am pretty sure this is a misconfiguration by me. Maybe you guys can help me out what I might be missing?
This is my configuration:
app.js
var $$ = Dom7;
var app = new Framework7({
root: '#app',
id: some_id,
name: 'some name',
theme: 'aurora',
// App root data
data: function () {
return {};
},
methods: {
},
},
routes: routes,
},
});
app.views.create('.view-main', {
url: '/'
});
routes.js
var routes = [
{
path: '/',
name: 'home',
options: {
animate: true,
transition: 'f7-circle',
},
componentUrl: './pages/home.html',
},
{
path: '/news/',
name: 'news',
options: {
animate: true,
transition: 'f7-dive',
},
componentUrl: './pages/news.html',
},
{
path: '/videos/',
name: 'videos',
options: {
animate: true,
transition: 'f7-dive',
},
componentUrl: './pages/videos.html',
},
// Default route (404 page). MUST BE THE LAST
{
path: '(.*)',
url: './pages/404.html',
},
];
This is the misconfiguration / error:
When the APP is started the first time at path “/” (home) navigating to
./pages/videos.html or
./pages/news.html
once works fine. All content for news or videos is showing up.
But switching from page
./pages/news.html to ./pages/videos.html or vice versa from
./pages/videos.html to ./pages/news.html
does not work.
Clicking on home again after that and clicking back to videos or news once DOES WORK again.
So clicking back to home fixes the functionality for ./pages/videos.html and ./pages/news.html.
Do I have to add ./pages/news.html and ./pages/videos.html to the views configuration aswell?
I do not understand why clicking back to home and after that to videos or news does fix the output.
Do you have got an idea what might be wrong?
Thanks,
Oliver