Skip to content

Commit

Permalink
Merge pull request #281 from xaoxuu/patch-1
Browse files Browse the repository at this point in the history
昵称和邮箱
  • Loading branch information
Nine authored Apr 22, 2020
2 parents 6c6e7b6 + ce4d15d commit 9889dcd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,14 @@ ValineFactory.prototype.bind = function (option) {
})
return;
}
if (defaultComment['nick'].length < 3) {
inputs['nick'].focus();
return;
}
if (defaultComment['mail'].length < 6 || defaultComment['mail'].indexOf('@') < 1 || defaultComment['mail'].indexOf('.') < 3) {
inputs['mail'].focus();
return;
}
if (defaultComment['comment'] == '') {
inputs['comment'].focus();
return;
Expand Down Expand Up @@ -1066,4 +1074,4 @@ function Valine(options) {
}

module.exports = Valine;
module.exports.default = Valine;
module.exports.default = Valine;

0 comments on commit 9889dcd

Please sign in to comment.