I need to reload the current page when I click my button or a href like we easily do with location.reload(); This sounds really simple but I cannot find the exact example for Framework7.
P.S. I am working on html-vanilla js, not with any other js framework.
Result: I solved the problem by fixing my js function and using Pull to Refresh (Official Doc) function.
But I really find documents page a bit difficult to understand. For example, I never understand where to place the code samples I see there. In the routes.js or my .f7 pages under pages folder…
There are loads of events and it depends on what you need, for example:
on global app (so this event will work in all pages):
var app = new Framework7({
...
on: {
pageInit: function (page) {
console.log('pageInit'); // in all page will print that on load.
},
....
Or in the component, for example that:
var smartSelect = app.smartSelect.create({
...
on: {
opened: function () {
console.log('Smart select opened') // obv, when smart select is opened print that
}
}
})
Or in local component like:
export default (props, {$on}) => {
$on('pageInit', function (page) {
// do something on page init
});
.....