使用方式
最后更新于:2022-04-02 03:14:24
[TOC]
## 使用方式
### 方式一:将校验规则写到控件中
```
```
### 方式二:将校验规则写到 js 代码中
```
$("#signupForm").validate({
rules: {
password: {
required: true,
minlength: 5
},
confirm_password: {
required: true,
minlength: 5,
equalTo: "#password"
},
messages: {
username: {
required: "请输入用户名",
minlength: "用户名必需由两个字母组成"
},
password: {
required: "请输入密码",
minlength: "密码长度不能小于 5 个字母"
},
})
});
```
';