Check out on gitHub, see the example on Demo page, see the document, extension.
Mainly, there are three parts consist of Javascript part:
form, schema and model.
Schema :
I like define the schema first. Usually you will use two props:
type, properties & required.
{ "type": "object", "title": "Somehting ele", "properties": { "email": { "title": "Email", "type": "string", "pattern": "^\\[email protected]\\S+$", "description": "Email will be used for evil." } }, "required": [ "email" ] }
In ‘properties‘, is the place where you define the form elements. For example - "email".
Form:
Then in the form, if you thing the schema setting is ok, then in form:
[ "email" ]
Also you can overwrite the form: for example, I want to over the title, add a placeholder.
{ "key": "email", "type": "string", "title": "Email filed", "placeholder": "Email" }
"key" in the example matchs to the "email" in the shcema.
A good example for input field:
Schema:
"email": { "title": "Email", "type": "string", "pattern": "^\\[email protected]\\S+$", "maxlength": 120, "minlength": 3, "validationMessage": "This is not an email" "description": "Email will be used for evil." }
Form:
{ "key": "email", "type": "string", "title": "Email filed", "placeholder": "Email" }
时间: 2024-10-13 00:54:10