framework7io / framework7-vue

Deprecated! Build full featured iOS & Android apps using Framework7 & Vue
http://framework7.io/vue/
MIT License
674 stars 151 forks source link

Framework 7 pages - Index page wont load but it has DOM #422

Closed pluckannfeel closed 6 years ago

pluckannfeel commented 6 years ago

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.

nolimits4web commented 6 years ago

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