zoukankan      html  css  js  c++  java
  • 关于MUI页面之间传值以及刷新的问题

    一、页面刷新问题

    1.父页面A跳转到子页面B,B页面修改数据后再跳回A页面,刷新A页面数据
    (1).父页面A代码
    window.addEventListener("pageflowrefresh", function (e) {
        location.reload();
    });
    (2).子页面B代码
    var main = plus.webview.currentWebview().opener();//获取父页面A对象
    var main = plus.webview.getWebviewById('A');//或者通过A页面id获取A页面对象
    mui.fire(main, "pageflowrefresh" );//出发A页面的pageflowrefresh方法
    mui.redirect('A','A.html');//跳转到A页面
     
     
    二、页面间传值问题
     
    1.从A页面传值到B页面(mui.fire()方式)
     
    (1).A页面代码
    var main = plus.webview.getWebviewById('B');
    mui.fire(main, "pageflowrefresh",{
        id:100
      })
     
    (2).B页面代码 www.bcty365.com
    window.addEventListener("pageflowrefresh", function (e) {
        //获得事件参数
        var id = e.detail.id;
    });
     
    2.从A页面传值到B页面(mui.方式)
     
    (1).A页面代码
    mui.openWindow({url:'B.html',extras:{id:'100'}});
     
    (2).B页面代码
    var self=plus.webview.currentWebview();//获取当前窗体对象
    var receiveID=self.id;//接收A页面传入的id参数值
  • 相关阅读:
    rails3 routes
    rails delete destroy difference
    ruby doc
    今天提交了一个patch开心,呵呵
    ruby collect map seems the function is the same?
    jquery closest
    rails 笔记
    网店系统
    rails脚本架命令及心得
    rails3 expericence
  • 原文地址:https://www.cnblogs.com/flowerM/p/11971599.html
Copyright © 2011-2022 走看看