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/

     
     
  • 相关阅读:
    树形dp入门
    D. Kilani and the Game(多源BFS)
    C. Ayoub and Lost Array
    poj3254(状压dp)
    CodeForces
    链式前项星(模板)
    “东信杯”广西大学第一届程序设计竞赛(同步赛)H
    最小生成树kruskal模板
    hdu-4763(kmp+拓展kmp)
    poj-3080(kmp+暴力枚举)
  • 原文地址:https://www.cnblogs.com/telwanggs/p/7513526.html
Copyright © 2011-2022 走看看