mui中页面之间传值
2017-07-30 08:42
253 查看
一种是在加载跳转页面时附加参数
下面是在跳转后页面接收值
当然也有一种情况是你想返回一个值给前一个页面,可以通过触发事件来传值
例如:request_person.html要返回值给new_requesst.html
request_person.html:
new_request.html:
当然在页面之间传值更为简单方式,就是使用web储存,将所用的值存在客户端
mui('.mui-table-view').on('tap','.mui-table-view-cell',function(){ var cell_id = this.getAttribute('id'); mui.openWindow({ id:'dynamics_detail.html', url:'dynamics_detail.html', extras:{ the_id:cell_id } }); });
下面是在跳转后页面接收值
mui.plusReady(function() { this_phoneNum = localStorage.getItem('phoneNum'); var self = plus.webview.currentWebview(); id = self.the_id; sendRequest(); });
当然也有一种情况是你想返回一个值给前一个页面,可以通过触发事件来传值
例如:request_person.html要返回值给new_requesst.html
request_person.html:
mui('.mui-table-view').on('tap','.mui-table-view-cell',function(){ var id = this.getAttribute('id'); var new_request = plus.webview.getWebviewById('new_request.html'); mui.fire(new_request,'requestPerson',{id:id}); mui.openWindow({ id:'new_request.html', }) })
new_request.html:
window.addEventListener('requestPerson',function(event){ //获得事件参数 var id = event.detail.id; requestPerson = id; document.getElementById('requestList').innerText = id; })
当然在页面之间传值更为简单方式,就是使用web储存,将所用的值存在客户端
localStorage.setItem("name",acount); localStorage.getItem("name");
相关文章推荐
- MUI动态页面c页面之间传值mui
- ASP页面之间传值
- 在JSP中使用el标签传递值(两个jsp页面之间传值)
- 安卓的页面之间传值
- 【Win10开发】如何在页面之间传值
- HTML5,MUI方式页面传值
- 通过协议在页面之间传值
- html 页面之间跳转和传值
- 使用MUI实现父子页面传值
- jsp中iframe在子页面和父页面之间传值
- ASP.NET 页面之间传值的几种方式
- 页面之间传值,常见的几种方式。
- ASP.NET页面之间传值的五种常用方法
- Mui --- 页面之间的传值
- jsp页面之间传值乱码问题解决
- 关于jsp页面之间传值的中文乱码总结
- 如何传值在2个页面之间 要求不刷新父页面,并且不能用Querystring传值
- asp.net页面之间传值的方式及C#中的索引器跟属性的区别
- ASP.NET页面之间传值的方式之Application
- React Native 页面之间传值、回传数据