Pageload常用的方法和说明
基础调用:$Q.pageload(opts)
opts对象的参数详情参考如下:
var opts = { url:'',//必填,待加载子页面的链接地址 title:'',//可选,显示的卡片标题 class:'card card-api card-page',//可选,自定义卡片的classname position:'c',//可选,加载引出位置,详情查看card的position name: this.createID('page',true),//可选,loadpage的唯一标识,可以自定义之后不同页面相互通讯 width:window.innerWidth+"px",//可选,自定义宽度 height:window.innerHeight+"px",//可选,自定义高度 type:"get",//可选,获取页面的请求方式,支持【get,post】 data:{},//可选,额外传入的参数信息 format : ['head','body'],//可选,loadpage卡片展示那些内容【head,body.foot】 hasMask:true,//可选,是否有背景层 bgClick:null,//可选,背景点击触发事件,屏蔽卡片内的其它元素的点击穿透 zIndex:1,//可选,卡片的层级结构信息 bgColor:'#00000040',//可选,如果有背景颜色的情况下背景颜色为多少 success:null,//可选,执行成功执行 message:null,//可选,接收到数据内容时候触发 }
默认的基础款
核心代码如下:
$Q.loadpage({ url:"http://local.kuoqps.com", type:"post", data:{a:"23","b":"2222"}, width:'80%', height:'80%', bgColor:'#0009', bgClick:function(){ this.cancel(); } });
完整的loadpage
核心代码如下:
$Q.loadpage({ url:"http://local.kuoqps.com", type:"post", format:["head","body","foot"], data:{a:"23","b":"2222"}, width:'80%', height:'80%', bgColor:'#0009', bgClick:function(){ this.cancel(); } });
加载body与foot的loadpage
核心代码如下:
$Q.loadpage({ url:"http://local.kuoqps.com", type:"post", format:["body","foot"], data:{a:"23","b":"2222"}, width:'80%', height:'80%', bgColor:'#0009', bgClick:function(){ this.cancel(); } });
最简洁的loadpage
核心代码如下:
$Q.loadpage({ url:"http://local.kuoqps.com", type:"post", format:["body"], data:{a:"23","b":"2222"}, width:'80%', height:'80%', bgColor:'#0009', bgClick:function(){ this.cancel(); } });