修正 prompt 设置强行设置非input,value.length报错

修正 prompt 设置强行设置非input,value.length报错
pull/54/head
meihangbo 2017-05-03 18:12:17 +08:00 committed by GitHub
parent c66ad46cfa
commit 477a0add41
1 changed files with 1 additions and 1 deletions

View File

@ -972,7 +972,7 @@ layer.prompt = function(options, yes){
var value = prompt.val();
if(value === ''){
prompt.focus();
} else if(value.length > (options.maxlength||500)) {
} else if(value&&value.length > (options.maxlength||500)) {
layer.tips('最多输入'+ (options.maxlength || 500) +'个字数', prompt, {tips: 1});
} else {
yes && yes(value, index, prompt);