简体   繁体   English

Gentics Mesh 模式中的新字段类型

[英]New field types in Gentics Mesh schema

I'd like to add custom field types like 'email' or other strings that could use regex validation.我想添加自定义字段类型,如“电子邮件”或其他可以使用正则表达式验证的字符串。

Also, numeric fields with validation like < or > or formatting like money.此外,具有 < 或 > 之类的验证或金钱之类的格式的数字字段。

I was thinking about storing a mapping of schema uuid + field name + field type, and have the UI query a new rest api to get the validation and formatting criteria when editing a node?我正在考虑存储模式 uuid + 字段名称 + 字段类型的映射,并让 UI 查询一个新的 rest api 以在编辑节点时获取验证和格式化标准?

Does that sound like a good approach?这听起来像是一个好方法吗? or is there a better one?还是有更好的?

I'm new to mesh, so I'm still learning how to approach customizations.我是网格新手,所以我仍在学习如何进行自定义。

Thanks!谢谢!

I think this relates to issue 112 .我认为这与问题 112有关。 At the moment it is not possible to add custom validation or custom field types.目前无法添加自定义验证或自定义字段类型。 In the future more specific constraints can be added.将来可以添加更具体的约束。 Additionally we also plan to add a "control" property to schema fields.此外,我们还计划向模式字段添加“控制”属性。 This field can be used to store any JSON.该字段可用于存储任何 JSON。 This JSON control property value can in turn be used in the UI to add custom form behavior or control how front-ends display/handle the value.这个 JSON 控件属性值又可以在 UI 中用于添加自定义表单行为或控制前端如何显示/处理该值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM