pageinit doesnt work on first load but it has elements, only js not working
<div data-page="index" data-name="index" class="page">
<!-- contents here -->
</div>
// to identify if the page is loading
$$(document).on('page:init', '.page[data-name="index"]', function (e){
console.log('index');
});
but if I return back to that page it loads now, why is that? and i check the details from first load, the page was not registered in routes. only after then it proceeded to other page and when return to index that was the time it got registered.
Happens because you assign your event listener AFTER home page was initialized, add this listener before app = new Framework7() then, or use router events instead
pageinit doesnt work on first load but it has elements, only js not working
but if I return back to that page it loads now, why is that? and i check the details from first load, the page was not registered in routes. only after then it proceeded to other page and when return to index that was the time it got registered.