zoukankan      html  css  js  c++  java
  • layui常见弹窗使用方法

    1:confim类型使用方法

    layui.use('layer', function(){

    layer.confirm('是否立即上传卷宗信息?', {
        btn: ['是','否'],
        time: 200000, //20s后自动关闭
        },function(index){

                                                    alert("这是点击确定按钮走的回调")

        layer.close(index);
      },function(){
         alert("这是点击取消按钮走的回调")
      });
    })

    2:open类型弹框,content参数可以是一个选择器也可以是一个路径

    layer.open({
    type : 1,
    title : "借阅时间",
    area : [ '450px', '300px' ],
    content : $("#borrowCase"),
    btn: ['确定', '取消'],
    yes: function(index){
      alert("这是点击确定按钮走的回调")
    },
    btn2: function(){
       alert("这是点击取消按钮走的回调")
    },
    end:function(){
    alert('这是点击任一按钮都会走的回调')
    }

    });

    layui.use('layer',function(){
    var layer=layui.layer;
    layer.open({
    type:2,
    title:'新增字段信息',
    area:['450px','300px'],
    content: "dictionary/addFiled?dictionaryId="+dictionaryId//字段类型
    })
    })

    3:msg类型

    layer.msg('添加借阅成功', {
        time: 1500, //1500ms后自动关闭

      });

    4:关闭弹窗

    layer_close(index)关闭当前弹窗

    parent.layer.closeAll()关闭所有的弹窗


    ————————————————
    版权声明:本文为CSDN博主「ygy211715」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/ygy211715/article/details/79976559

  • 相关阅读:
    es手动创建索引,修改索引,删除索引
    es的scoll滚动查询技术
    es倒排索引和正排索引
    linux中按照指定内容查找文件
    es定制排序搜索结果
    es中如何定位不合法搜索
    es中filter和query的对比
    es组合多个条件进行查询
    手动建立mapping以及增加属性
    30分钟学会如何使用Shiro
  • 原文地址:https://www.cnblogs.com/dayin1/p/11542389.html
Copyright © 2011-2022 走看看