zoukankan      html  css  js  c++  java
  • swal用法

    swal({
      title: "确认删除?",
      text: "Your will not be able to recover this imaginary file!",
      type: "warning",
      showCancelButton: true,
      confirmButtonColor: "#DD6B55",
      confirmButtonText: "确认",
      cancelButtonText: "取消",
      closeOnConfirm: false,
      closeOnCancel: false
    },
    function(isConfirm){
      if (isConfirm) {
        swal("Deleted!", "Your imaginary file has been deleted.", "success");
      } else {
    	    swal("Cancelled", "Your imaginary file is safe :)", "error");
      }
    });
    
    
    
    
    function edit(){
        swal({
            title: "编辑订单",
            text: "修改订单金额",
            type: "input",
            showCancelButton:true,
            closeOnConfirm:false,
            confirmButtonText:"确认",
            cancelButtonText:"取消",
            animation: "slide-from-top",
            inputPlaceholder: "输入订单金额"
        },
        function (inputValue){
            if(inputValue){
                var re = /^[1-9]+[0-9]*]*$/;
                if(!re.test(inputValue)){
                    swal("订单金额只能是一个正整数");
                }else{
                    swal(inputValue);
                }
                    
            }else{
                swal("输入不能为空");
                
            }
        }
        
        );
    }
    
    可参考地址:

    http://www.dglives.com/demo/sweetalert-master/example/

     
     
  • 相关阅读:
    Linux进阶之Linux中的标准输入输出
    PermCheck
    FrogRiverOne
    PermMissingElem
    FrogJmp
    TapeEquilibrium
    恒生电子长沙2016实习生笔试题
    接口和抽象类的异同点?
    C#实现二叉树
    C#实现栈和队列
  • 原文地址:https://www.cnblogs.com/telwanggs/p/7513526.html
Copyright © 2011-2022 走看看