多视图布局Framework7混合应用程序

时间:2016-03-29 12:51:42

标签: javascript mobile hybrid html-framework-7

我有两种不同的布局。一个用于登录前,另一个用于登录后。

我已经阅读了这里的说明。 http://framework7.io/docs/views.html

仍然无法理解为什么我的应用会变成这样:

Middle part of this application

一次显示2个视图。可以完全滚动两个视图。

这是涉及的js:

var mainView = myApp.addView('.view-main');
var anotherView = myApp.addView('.another-view');

//to call anotherView after login
mainView.router.load(anotherView);

1 个答案:

答案 0 :(得分:1)

每个视图都只是一个包含自己内容和自己历史的div。所以,只需将它们用作div:

var mainView = myApp.addView('.view-main');
var anotherView = myApp.addView('.another-view');
//init your application somwhere here
$$('.another-view').hide(); //hide view that after login
//do somethig and login
$$('.view-main').hide(); //hide view that before login
$$('.another-view').show(); //show wiew that after login

当然,这是使用视图的非常奇怪的方式,但我希望你知道你在做什么。请再次阅读文档。