Field types are component rending field in view(including inline) or edit mode. It's possible to have your own implemention of a field type.
//Put below when you start the app.//register an image fieldtype componentFieldRegister.registerComponent( 'image', Image );//register a customize image component in article's cover_image(identifier)FieldRegister.register( 'article/cover_image', CoverImage )
const CustomField = (props:FieldtypeProps)=>{//render in mode(edit/view/inline)}
Below is FieldtypeProps properties:
Prop name | Type | Default | Required | Description |
---|---|---|---|---|
definition | any | — | true | field definition |
validation | any | — | false | validation in this field |
data | any | — | true | data on this field |
mode | string | — | true | mode |
contenttype | string | — | true | contenttype the field in |
formdata | any | — | true | whole data |
formValidation | any | — | true | whole validation |