(有头部菜单,其中一个界面又有tab的时候)
1、frameGroup嵌套:frame优先级,如何使所点击frame在最前面。
①api.bringFrameToFront({ from: formPage,
to: topage });
②点击的时候,用api.setFrameGroupAttr把不想要的framegroup 隐藏起来,想要的显示出来。
if(ret.index!=3){ api.setFrameGroupAttr({ name: 'TabFrameGroup', hidden: true }); api.setFrameGroupAttr({ name: 'indexGroup', hidden: false }); }else{ api.setFrameGroupAttr({ name: 'TabFrameGroup', hidden: false }); }
2、登录页跳回个人中心页,并刷新frameGroup中的个人中心页的用户名:用exescript
①login/register页面写一下代码,登录注册成功用使用:
api.execScript({
name:'root',//这里的root代表index.html这个是为什么。看文档
frameName:'personCenter',//个人中心页
script:‘setData("zhangsan")'
});
②personCenter.html页面写下面代码 ,定义setData(name){}
function setData(name){
$(“#UserName”) .text(name)
}
转载请注明原文地址: https://ju.6miu.com/read-962530.html