[SOLVED] Page:afterin not called on initial app load


#1

I’m trying to bind the click event to some links on the first page loaded by F7. However, page:afterin is not called on initial page load. If I return to the page, then page:afterin is properly called and the click event works. I’m on F7 3.3.2

$$(document).on('page:afterin', '.page[data-name="home"]', function (e) {

    $$('.page-current .delete-link').on('click', function () {
        consloe.log('Ok');
    });

});

#2

I fixed the problem by using the “Initial Page Route”:

https://framework7.io/docs/view.html#router-api-methods-properties