blockly > 輸入 > insertFieldAt

Input.insertFieldAt() 方法

這個外掛程式能在輸入內容欄位列的位置,插入欄位 (或字串中的標籤),以及所有前置字串和後置字串欄位。

Signature:

insertFieldAt<T>(index: number, field: string | Field<T>, opt_name?: string): number;

參數

參數 類型 說明
index 號碼 要插入欄位的索引。
欄位 字串 | 欄位<T> 要新增為欄位的內容。
opt_name 字串 (選用) 語言中立 ID,可能會用於再次找到這個欄位。必須為主機區塊專屬。

傳回:

號碼

最後一個插入欄位後方的索引。