Closed rideddy84 closed 2 years ago
I use below plugins options.
import svk from 'mobx-react-form/lib/validators/SVK'; import ajv from 'ajv'; const plugins = (schema): svk => ({ svk: svk({ package: ajv, schema, options: { errorDataPath: 'property', allErrors: true, coerceTypes: true, v5: true, }, // ajv options }), }); export default plugins;
I am happy with this module in general, but I have two problems.
Localization The ajv has lots of sub packages like ajv-i18n. But I can't find the way to enable them in mobx-react-form.
ajv
ajv-i18n
mobx-react-form
I can't enable required message.
const $schema = { type: 'object', properties: { id: { type: 'string', minLength: 5, maxLength: 20, }, password: { type: 'string', minLength: 6, maxLength: 20 }, username: { type: 'string', minLength: 6, maxLength: 20 }, }, required: ['id', 'password', 'username'], };
This is my schema. But only minLength error messages appear.
Thanks.
I use below plugins options.
I am happy with this module in general, but I have two problems.
Localization The
ajv
has lots of sub packages likeajv-i18n
. But I can't find the way to enable them inmobx-react-form
.I can't enable required message.
This is my schema. But only minLength error messages appear.
Thanks.