ayer.prompt 怎样让输入值为空也可以向下执行

Posted yufeiyunsui

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ayer.prompt 怎样让输入值为空也可以向下执行相关的知识,希望对你有一定的参考价值。

http://fly.layui.com/jie/4227/

 

layer.prompt({
title: ‘输入任何口令,并确认‘,
formType: 1, //prompt风格,支持0-2
value:‘‘
}, function(value){
alert(value);
});

 

 

这是因为框架代码中,对输入内容做了校验,解决方案如下:
1.找到layer.js;
2.寻找到yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数"
3.将这一句屏蔽掉 ""===n?s.focus():
4.强刷浏览器。

以上是关于ayer.prompt 怎样让输入值为空也可以向下执行的主要内容,如果未能解决你的问题,请参考以下文章