一个用于存储短文本内容的文本输入字段,例如标题或描述。
对于缩进、加粗和其他格式,请使用富文本字段类型。
有关所有字段类型的其他常见属性,请查看字段类型定义。
将此设置为 "string"
以使用字符串字段。
用于内部使用的字段名称。
All properties marked as REQUIRED must be specified for the field to work properly.
{type: 'string',name: 'title',label: '标题'}
设置 list: true 将使值成为一个数组
{type: 'string',name: 'title',label: '标题',list: true}
默认情况下,文本字段用于字符串。要使用不同的核心字段插件,请通过 ui.component 属性指定。
{label: "描述",name: "description",type: "string",ui: {component: "textarea"}}
您可以为TinaCMS编辑器创建自己的组件来存储字符串类型的内容。
{label: "标题",name: "title",type: "string",ui: {component: ({ input }) => {return (<div><label htmlFor="title">标题: </label><input {...input}></input></div>);},},}