-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type:integer的判断是不是有问题? #265
Comments
估计你需要把value先transform成数字,parseInt(age, 10) {
rules: [
{
transform(value) {
return parseInt(value, 10)
}
}
]
} |
正解 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/js文件
data{
agerules:[
{
type:"integer",
trigger:"change",
message:'年龄必须为整数!'
},
{
min: 1,
max: 3,
message: '超出范围年龄:0-99!',
trigger:"change"
},
{
required: true,
trigger:"change",
message:'年龄不能为空'
}
],
}
我在js这样写,然后前端输入年龄时,输入整数20,30,33这些全都报错,说不是整数。该怎么解决呢?
是我的写法出错了嘛?
The text was updated successfully, but these errors were encountered: