研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >输入 >输入 >insertFieldAt
在输入内容的字段行的位置插入一个字段(或字符串中的标签),以及所有前缀和后缀字段。
Signature:
insertFieldAt<T>(index: number, field: string | Field<T>, opt_name?: string): number;
参数
参数 |
类型 |
说明 |
索引 |
number |
要插入字段的索引。 |
字段 |
字符串 |字段<T> |
需要添加为字段的内容。 |
opt_name |
字符串 |
(可选)与语言无关的标识符,可用于再次查找此字段。对于主机块而言应该是唯一的。 |
返回:
number
最后插入字段后面的索引。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["The `insertFieldAt()` method adds a field or label to a specific position within a block's input row."],["It accepts an index to specify the insertion point, the field or label to insert, and an optional name for the field."],["The method returns the index of the position after the newly inserted field."]]],[]]