mui自定义事件传参

例如 要把参数从页面a.html传到页面b.html(同目录)

a.html页面中:

             //获得页面的webview
                var view = plus.webview.getWebviewById(‘b.html‘);
                mui.fire(view,‘goit‘,{name:‘007‘});
                mui.openWindow({url:‘b‘});

b.html页面中:(获取方式:e.detail.xxx)

        window.addEventListener(‘ljgm‘, function(e){
             //获取参数值
              var name = e.detail.name;
        });
时间: 2024-08-08 09:38:25

mui自定义事件传参的相关文章

datasnap远程方法支持自定义对象传参

有同仁需要远程方法传输自定义的数据类型,他以为要自己写代码会很复杂,其实DATASNAP早就为我们想到了. datasnap的数据序列和还原真是无与伦比的强大,其远程方法支持自定义对象传参,DATASNAP会自动使用JSON序列和还原自定义的对象. 1)自定义一个对象 type TMyInfo = class(TObject) public AccountNo: string; SQL: string; Params: string; RecsMax: Integer; end; 2)服务端远程

mui---mui.fire触发自定义事件传事件对象中的参数

fire_event_send_page.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-

bindtap事件传参

<!-- 传参 --><view bindtap='operation' data-item='{{item}}'> // 获取 operation: function (e) { var item = e.currentTarget.dataset.item; console.log(item); }, 原文地址:https://www.cnblogs.com/knightdreams6/p/11132037.html

js事件传参

阻止事件发生之前就执行了函数 除了创建匿名函数 function foo(a){ console.log(a); } document.onclick=foo(1) //document.onclick=function(){foo(1)} // document.addEventListener('click',foo(1),false) 另外有bind() function foo(a){ console.log(a); } document.onclick=foo.bind(null,2)

js onclick事件传参

传字符串参数 var html = "<a href='#' onclick='onedit(""+ row.name + "")';>编辑</a>"

用闭包实现事件传参

<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> .box { width: 100px; height: 100px; background-color: goldenrod; position: absolute; left: 0; } </style

elementUi中的计数器ele-mumber中的change事件传参及事件调用

业务场景是需要在点击业务工作量的时候设置任务工作量这一项的评分不能大于任务质量及任务时限的权重之和除以二 上代码 JS逻辑代码 因出现弹出层提示后设置输入框的值如果大于sum的值,设置输入的值为sum,但是出现了让input输入的值只能变成sum一次,之后再输入值也不改变,属性值没有响应式了 故用setTimeout定时器等页面全部加载完成后调用定时器,设置输入框的值等于sum 原文地址:https://www.cnblogs.com/jiajialove/p/10739719.html

行内 onclick事件 传参报错

js创建了一个a标签 row.id 为后台获取的数据   拼接到fun()函数中 actions.push('<a href="javascript:void(0)" class="btn" onclick=\'fun("'+row.id+'")\' ></a>'); 原文地址:https://www.cnblogs.com/webmc/p/12431005.html

MUI APP关于页面之间的传值,plusready和自定义事件

最近在用MUI开发这个APP,发现有时候这个plusready不起作用,表现在,这个页面如果重复打开,这个plusready就进不去,然后上一个页面传过来的值,就没法接收了.这个经过MUI官方确认,是有可能发生的,所以,这里面的话,就需要通过自定义事件,来确保这个值能正确传递. 首先,我先演示一下,通常我们页面之间的传值的方法,如下: 参数生成页面: mui.openWindow({ id: 'lightMapMain.html', url: 'lightMapMain.html', show: