framework7 init未在页面init上触发

时间:2018-12-21 13:15:47

标签: javascript jquery mobile html-framework-7

Init在框架7中不起作用 我已经尝试了以下链接中给出的所有解决方案 framework7 Page Init Event Not Firing

Text

1 个答案:

答案 0 :(得分:0)

添加初始化为假

var myApp = new Framework7({    
    animateNavBackIcon: true,
    // Enable templates auto precompilation
    precompileTemplates: true,
    // Enabled pages rendering using Template7
    swipeBackPage: false,
    swipeBackPageThreshold: 1,
    swipePanel: "left",
    swipePanelCloseOpposite: true,
    pushState: true,
    pushStateRoot: undefined,
    pushStateNoAnimation: false,
    pushStateSeparator: '#!/',
    template7Pages: true,
    init:false
});

然后手动初始化

// Export selectors engine
var $ = Dom7;

// Add main View
var mainView = myApp.addView('.view-main', {
    // Enable dynamic Navbar
    dynamicNavbar: false
});

$(document).on('page:init', function (e) {
    console.log("Please Run");
});

myApp.init();

您正在使用哪个版本的框架