Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

能不能自定义message啊 #31

Closed
lizifa opened this issue Feb 9, 2018 · 2 comments · Fixed by #68
Closed

能不能自定义message啊 #31

lizifa opened this issue Feb 9, 2018 · 2 comments · Fixed by #68
Labels

Comments

@lizifa
Copy link

lizifa commented Feb 9, 2018

能不能自定义message啊

@blockmood
Copy link

同问!

sarike added a commit to sarike/parameter that referenced this issue Jun 22, 2019
fengmk2 added a commit that referenced this issue Mar 14, 2023
closes #31
closes #15 

所有的 rule 中添加字段 “message",可以自定义错误信息,完全向前兼容。

rule 示例:

```
{
    type: 'int', 
    max: 200,
    message: {
        max: '年龄不能大于 200 岁',
        required: '请填写你的年龄'
    }
}
```

```
{
    type: 'email', 
    message: {
        email: '邮箱格式不正确',
        required: '前输入您的邮箱'
    }
}
```

Co-authored-by: fengmk2 <fengmk2@gmail.com>
fengmk2 pushed a commit that referenced this issue Mar 14, 2023
[skip ci]

## [3.7.0](v3.6.0...v3.7.0) (2023-03-14)

### Features

* custom error message ([#68](#68)) ([818cd23](818cd23)), closes [#31](#31) [#15](#15)
@github-actions
Copy link

🎉 This issue has been resolved in version 3.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants