mui.fire()用法,触发目标窗口的自定义事件

mui.fire( 目标窗口的webview , '自定义事件名' ,{参数列表};)

目标窗口监听这个自定义事件
window.addEventListener('自定义事件名',function(){

})


//需要刷新的页面的id
var pageId = "examples/shopping.html";
//根据页面id获取页面
var page = plus.webview.getWebviewById(pageId);
mui.fire(page, 'refresh');

目标页面接收的:

window.addEventListener('refresh', function(event) { //自定义,点击底部购物车页面刷新
  location.reload();
});



猜你喜欢

转载自www.cnblogs.com/li-sir/p/11990003.html
今日推荐