diff --git a/src/layer.js b/src/layer.js index 0cc4e0d8..0b128cb9 100644 --- a/src/layer.js +++ b/src/layer.js @@ -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);