Blockly 于 2025 年 11 月 10 日移至 Raspberry Pi Foundation!请阅读博文和常见问题解答。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
blockly > FieldCheckbox
FieldCheckbox 类
复选框字段的类。
Signature:
export declare class FieldCheckbox extends Field<CheckboxBool>
扩展: 字段<CheckboxBool>
构造函数
属性
| 属性 |
修饰符 |
类型 |
说明 |
| CHECK_CHAR |
static
readonly
|
(not declared) |
对勾标记的默认字符。 |
| SERIALIZABLE |
|
布尔值 |
序列化字段会由序列化程序保存,非序列化字段则不会。可修改的字段也应可序列化。 |
| value_ |
|
boolean | null |
注意:默认值在 Field 中设置,因此请保留该值,而不是在此处或构造函数中覆盖该值。 |
方法
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-25。"],[],["The `FieldCheckbox` class, extending `Field`, represents a checkbox. Key actions include: constructing a new checkbox instance, configuring it with options, and validating input as 'TRUE' or 'FALSE'. It updates the field's value and check element. Methods allow retrieving the text, boolean value, and setting the check mark character. It also manages display text, initializes the block UI, handles rendering, and toggles the checkbox state on clicks. Default check mark characters are defined.\n"]]