mui框架中dialog框的实现

<script type="text/javascript" charset="utf-8">
            //mui初始化
            mui.init({
                swipeBack: true //启用右滑关闭功能
            });
            var info = document.getElementById("info");
            document.getElementById("alertBtn").addEventListener('tap', function() {
                mui.alert('欢迎使用Hello MUI', 'Hello MUI', function() {
                    info.innerText = '你刚关闭了警告框';
                });
            });
            document.getElementById("confirmBtn").addEventListener('tap', function() {
                var btnArray = ['', ''];
                mui.confirm('MUI是个好框架,确认?', 'Hello MUI', btnArray, function(e) {
                    if (e.index == 1) {
                        info.innerText = '你刚确认MUI是个好框架';
                    } else {
                        info.innerText = 'MUI没有得到你的认可,继续加油'
                    }
                })
            });
            document.getElementById("promptBtn").addEventListener('tap', function(e) {
                e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug,使用plus.nativeUI.prompt会造成输入法闪一下又没了
                var btnArray = ['取消', '确定'];
                mui.prompt('请输入你对MUI的评语:', '性能好', 'Hello MUI', btnArray, function(e) {
                    if (e.index == 1) {
                        info.innerText = '谢谢你的评语:' + e.value;
                    } else {
                        info.innerText = '你点了取消按钮';
                    }
                })
            });
            document.getElementById("toastBtn").addEventListener('tap', function() {
                mui.toast('欢迎体验Hello MUI');
            });
        </script>

 

<script type= "text/javascript"  charset= "utf-8" >
             //mui初始化
             mui.init({
                 swipeBack:  true  //启用右滑关闭功能
             });
             var  info = document.getElementById( "info" );
             document.getElementById( "alertBtn" ).addEventListener( 'tap' function () {
                 mui.alert( '欢迎使用Hello MUI' 'Hello MUI' function () {
                     info.innerText =  '你刚关闭了警告框' ;
                 });
             });
             document.getElementById( "confirmBtn" ).addEventListener( 'tap' function () {
                 var  btnArray = [ '否' '是' ];
                 mui.confirm( 'MUI是个好框架,确认?' 'Hello MUI' , btnArray,  function (e) {
                     if  (e.index == 1) {
                         info.innerText =  '你刚确认MUI是个好框架' ;
                     else  {
                         info.innerText =  'MUI没有得到你的认可,继续加油'
                     }
                 })
             });
             document.getElementById( "promptBtn" ).addEventListener( 'tap' function (e) {
                 e.detail.gesture.preventDefault();  //修复iOS 8.x平台存在的bug,使用plus.nativeUI.prompt会造成输入法闪一下又没了
                 var  btnArray = [ '取消' '确定' ];
                 mui.prompt( '请输入你对MUI的评语:' '性能好' 'Hello MUI' , btnArray,  function (e) {
                     if  (e.index == 1) {
                         info.innerText =  '谢谢你的评语:'  + e.value;
                     else  {
                         info.innerText =  '你点了取消按钮' ;
                     }
                 })
             });
             document.getElementById( "toastBtn" ).addEventListener( 'tap' function () {
                 mui.toast( '欢迎体验Hello MUI' );
             });
         </script>

转载于:https://www.cnblogs.com/vesnawsx/p/9511324.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值