Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down