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