Mui-自定义事件跳转带参数
Posted fdxjava
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mui-自定义事件跳转带参数相关的知识,希望对你有一定的参考价值。
---event.html
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <link href="css/mui.min.css" rel="stylesheet" /> </head> <body> <div class="mui-content"> <ul class="mui-table-view" id="lists"> <li class="mui-table-view-cell" id="1">列表一</li> <li class="mui-table-view-cell" id="2">列表一</li> <li class="mui-table-view-cell" id="3">列表一</li> </ul> </div> <script src="js/mui.min.js"></script> <script type="text/javascript"> mui.init(); /*真机环境下运行调试*/ mui.plusReady(function() /*进行预加载,用户没有点击是就已经加载完成*/ var prPage = mui.preload(url:‘info.html‘,id:‘info.html‘); mui(‘#lists‘).on(‘tap‘,‘li‘,function() mui.fire(prPage,‘newsinfoEvent‘,‘title‘:this.innerHTML,‘id‘:this.getAttribute(‘id‘)); mui.openWindow(url:‘info.html‘,id:‘info.html‘); ); ); </script> </body> </html>
---info.html
<!doctype html> <html> <head> <meta charset="UTF-8"> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> <link href="css/mui.min.css" rel="stylesheet" /> </head> <body> <header class="mui-bar mui-bar-nav"> <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a> <h1 class="mui-title" id="title1"></h1> </header> <div class="mui-content"> </div> <script src="js/mui.min.js"></script> <script type="text/javascript"> mui.init(); mui.plusReady(function() window.addEventListener(‘newsinfoEvent‘,function(e) var title1 = mui(‘#title1‘); title1[0].innerHTML = e.detail.title; mui.toast(e.detail.id); ); ); </script> </body> </html>
以上是关于Mui-自定义事件跳转带参数的主要内容,如果未能解决你的问题,请参考以下文章