使用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这方法...

阅读 3.7k
2 个回答

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

新手上路,请多包涵

我也遇到这个问题了,感谢你的答案

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题