1、mui.alert() 普通提醒
参数
1、message Type: String 提示对话框上显示的内容 2、title Type: String 提示对话框上显示的标题 3、btnValue Type: String 提示对话框上按钮显示的内容 4、callback Type: Function 提示对话框上关闭后的回调函数 5、type Value: 'div'是否使用h5绘制的对话框
演示代码
mui.alert('欢迎使用Hello MUI', 'Hello MUI', function() { mui.toast('你刚关闭了警告框'); });
2、mui.confirm() 确定消息框
参数
1、message Type: String 提示对话框上显示的内容 2、title Type: String提示对话框上显示的标题 3、btnValue Type: Array 提示对话框上按钮显示的内容 4、callback Type: Function 提示对话框上关闭后的回调函数 5、type Value: 'div' 是否使用h5绘制的对话框
演示代码
var btnArray = ['取消', '确定']; mui.confirm('真的要删除吗?','Hi...',new Array('否','是'),function(e){ if(e.index == 1){mui.toast('是');}else{mui.toast('否');} });
3、mui.prompt() 输入框
参数
message Type: String 提示对话框上显示的内容 placeholder Type: String 编辑框显示的提示文字 title Type: String 提示对话框上显示的标题 btnValue Type: Array 提示对话框上按钮显示的内容 callback Type: Function提示对话框上关闭后的回调函数 type Value: 'div' 是否使用h5绘制的对话框
演示代码
var btnArray = ['取消', '确定']; mui.prompt('请输入您的姓名?','Hi...',new Array('取消','确定'),function(e){ if(e.index == 1){ mui.toast(e.value); }else{ mui.toast('您取消了输入'); } });
4、mui.toast() 自动消失的消息框
mui.toast('hi...');