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/

     
     
  • 相关阅读:
    02-01官网静默模式安装WebLogic
    01-java技术体系基础
    MySQL安装的三种方式
    centos虚拟机初始化脚本
    Nginx编译配置介绍
    word发布博客至博客园
    Bash shell编程的语法知识点(1)
    c=$[$c%5]到let c=$c%5的转换
    <转>shell经典,shell十三问
    进程管理工具htop/glances/dstat的使用
  • 原文地址:https://www.cnblogs.com/telwanggs/p/7513526.html
Copyright © 2011-2022 走看看