猿问

使用framework7 时报错 addView is not a function

根据文档 来做的


// Initialize app

var myApp = new Framework7();



// If we need to use custom DOM library, let's save it to $$ variable:

var $$ = Framework7.$;


console.log(myApp.addView);


// Add view

var mainView = myApp.addView('.view-main', {

    // Because we want to use dynamic navbar, we need to enable it for this view:

    dynamicNavbar: true

});

然后我搜索了 framework7 源码 根本没有找到 addView这方法...

慕尼黑5688855
浏览 1073回答 1
1回答

潇湘沐

framework7 v2 已改成myApp.views.create('.view-main', {...});
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答