关于MUI框架中的警告框

来源:互联网 发布:搜狗输入法添加到mac 编辑:程序博客网 时间:2024/06/14 03:54


1、mui.alert() 普通提醒
参数

1message Type: String 提示对话框上显示的内容2title Type: String 提示对话框上显示的标题3btnValue Type: String 提示对话框上按钮显示的内容4callback Type: Function 提示对话框上关闭后的回调函数5type Value: 'div'是否使用h5绘制的对话框

演示代码

mui.alert('欢迎使用Hello MUI', 'Hello MUI', function() {   mui.toast('你刚关闭了警告框');});


2、mui.confirm() 确定消息框
参数

1message Type: String 提示对话框上显示的内容2title Type: String提示对话框上显示的标题3btnValue Type: Array 提示对话框上按钮显示的内容4callback Type: Function 提示对话框上关闭后的回调函数5type 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...');
原创粉丝点击