|
楼主 |
发表于 2017-1-9 10:30:04
|
显示全部楼层
本帖最后由 ufo1982ufo 于 2017-1-9 10:43 编辑
- /////////////////////////////////////////////////SPA传参url
- Model.prototype.infoview = function(event){
- debugger;
- var id = event.bindingContext.$object.val('info_id');
- // var url = require.toUrl('./infolist.w');
- // var url = require.toUrl('./infodetail.w?id='+id);
- // window.location.href = url; //通过设置window.location.href实现页面跳转
- var url = require.toUrl('./infolist.w');
- var params = {data:{id:id}}; //xz正确的
- this.getParentModel().comp('windowContainer4').load(url,params); //调父业windowcontainer并传参
- this.getParentModel().comp('contents').to('infodetailcontent'); //调父业contents
- };
- /////////////////////////////////////////////////SPA传参url
复制代码
加载2次首页应该是由于contens的active设置的原因。
如下的代码,会一直在首页,无法切换到对应的content。
this.getParentModel().comp('windowContainer4').load(url,params);
this.getParentModel().comp('contents').to('infodetailcontent');
我颠倒后,会切换到对应的content,但是event.params.data就是undefined了。
this.getParentModel().comp('contents').to('infodetailcontent');
this.getParentModel().comp('windowContainer4').load(url,params);
需要怎么改才可以带着参数切换对应的content,使windowContainer加载w页面并传参?
打开对应windowcontainer的路由功能就可以了!
|
|