blockly > FieldTextInput > (构造函数)
FieldTextInput.(constructor)
构造 FieldTextInput
类的新实例
Signature:
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldTextInputValidator | null, config?: FieldTextInputConfig);
参数
参数 | 类型 | 说明 |
---|---|---|
value | 字符串 | 类型:Field.SKIP_SETUP | (可选)字段的初始值。应转换为字符串。如果为 null 或 undefined,则默认为空字符串。如果您希望跳过设置,则还接受 Field.SKIP_SETUP(仅供想在其构造函数运行后处理配置和设置字段值的子类使用)。 |
validator | FieldTextInputValidator | null | (可选)为验证字段值更改而调用的函数。接受字符串并返回经过验证的字符串,或者返回 null 以取消更改。 |
config | FieldTextInputConfig | (可选)用于配置字段的选项的映射。如需查看此参数支持的属性列表,请参阅 [字段创建文档]https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/text-input#creation。 |