弹出框不输入任何字符的情况下点击confirm不能继续

Code:

layer.prompt({title: 'PopUp', formType: 2,area: ['500px', '100px'],btn: ['Confirm','Cancel'],maxlength:600 }, function(reason, index){
                        layer.close(index);
                        GroupM_LoadingShow();
                        alert(reason);  
                    });

layer.prompt也是继承layer.open的,如果直接用原方法yes就可以了

layer.prompt({
                        title: 'Comments', formType: 2, area: ['500px', '100px'], btn: ['Confirm', 'Cancel'], maxlength: 600,
                        yes: function (index, commentsInput){
                            layer.close(index);
                            GroupM_LoadingShow();
                            alert(commentsInput.find(".layui-layer-input").val())
                            }});

注意两种用法的function的参数格式不一样。

 

posted on 2019-03-12 15:00  MichelleDawm  阅读(344)  评论(0编辑  收藏  举报