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