鍍金池/ 問答/網(wǎng)絡(luò)安全  HTML/ 使用framework7 時報(bào)錯 addView is not a functi

使用framework7 時報(bào)錯 addView is not a function

根據(jù)文檔 來做的

// 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這方法...

回答
編輯回答
莓森

framework7 v2 已改成myApp.views.create('.view-main', {...});
推薦大家去看 英文官方文檔

2018年5月18日 15:56
編輯回答
喜歡你

我也遇到這個問題了,感謝你的答案

2017年12月5日 20:17