【发布时间】:2019-01-18 08:06:52
【问题描述】:
我想问以下问题: 我有 2 个主框架; app-root 和仪表板。
app.js:
if (LS.getItem('Bearer') != null) {
application.run({ moduleName: "dashboard/root" });
} else {
application.run({ moduleName: "app-root" });
}
app-root.hxml
<Frame defaultPage="login/login" id="app-root"></Frame>
app.root 是第一帧,它包含登录和注册页面。
仪表板框架:
登录页面有登录按钮,点击加载仪表板页面
var frameModule = require('ui/frame');
frameModule.topmost().navigate("dashboard/root");
现在,仪表板框架已加载。仪表板框架有一些底部导航,每个都存在并用作页面之间的导航。
我在仪表板中也有注销按钮,用于清除一些数据,然后导航到登录页面。
现在我的问题/问题是 - > 在登录页面中,我在此页面中看到仪表板的按钮导航,这意味着我猜我做错了什么。我假设主框架是仪表板,但为什么不是登录页面?在导航到登录页面之前,有没有办法“卸载”仪表板框架?当然,如果我关闭应用程序并再次运行,logijn 页面看起来不错,没有任何 dahsboard 的框架元素...
谢谢你的建议。
仪表板:
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="load" id="test" >
<GridLayout rows="*,60" class="c1" id="nawRows">
<Frame defaultPage="dashboard/dashboard/dashboard/" id="dashboard" class="c2"></Frame>
<GridLayout row="1" class="xx">
<StackLayout verticalAlignment="bottom" row="2" class="bottom-nav">
<GridLayout rows="*" columns="*,*,*,*,*,*" height="70" id="main-ic0">
<Label class="icon0 foot-icon" row="0" col="0" tap="{{ loadPage }}" data-id="0" id="ico0"></Label>
<Label class="icon1 foot-icon" row="0" col="1" tap="{{ loadPage }}" data-id="1" id="ico1"></Label>
<Label class="icon2 foot-icon" row="0" col="2" tap="{{ loadPage }}" data-id="2" id="ico2"></Label>
<Label class="icon3 foot-icon" row="0" col="3" tap="{{ loadPage }}" data-id="3" id="ico3"></Label>
<Label class="icon5 foot-icon" row="0" col="4" tap="{{ loadPage }}" data-id="5" id="ico4"></Label>
<Label class="icon4 foot-icon" row="0" col="5" tap="{{ loadPage }}" data-id="4" id="ico5"></Label>
</GridLayout>
</StackLayout>
</GridLayout>
【问题讨论】:
-
你在
dashboard-root.xml有什么? -
标签: nativescript