美文网首页
layer弹出输入框

layer弹出输入框

作者: 前端来入坑 | 来源:发表于2019-12-08 13:42 被阅读0次
  • 使用layer.open({})弹出输入框
         layer.open({
            id:1,
            type: 1,
            title:'请输入问题',
            style: 'width:80%;height:auto;',
            content: "<div style='display:flex;justify-content:center;'><textarea id='area' style='width:100%;height:135px;'></textarea></div>",
            btn:['保存','取消'],
            yes:function (index,layero) {
                 //获取输入框里面的值
                var closeContent = top.$("#area").val() || $("#area").val();
                if(closeContent){
                    console.log(closeContent);
                }
                layer.close(index);
                // 在这里提交数据
            },
            no:function (index,layero) {
                 layer.close(index);
            }
        });
        textarea{
            outline:none;
            resize:none
        }
image.png

官网:layer for mobile

相关文章

网友评论

      本文标题:layer弹出输入框

      本文链接:https://www.haomeiwen.com/subject/zjhavctx.html