FieldTextInput.(constructor)
建構 FieldTextInput 類別的新例項
Signature:
constructor(value?: string | typeof Field.SKIP_SETUP, validator?: FieldTextInputValidator | null, config?: FieldTextInputConfig);
參數
| 參數 | 類型 | 說明 |
|---|---|---|
| 值 | 字串 |Field.SKIP_SETUP 類型 | (選用) 欄位的初始值。應轉換為字串。如果空值或未定義,預設為空白字串。如果要略過設定程序,也接受 Field.SKIP_SETUP (僅適用於需要處理設定及在其建構函式執行後設定欄位值的子類別)。 |
| 驗證工具 | FieldTextInputValidator |空值 | (選用) 系統會呼叫此函式,驗證欄位值變更情形。擷取字串,傳回驗證字串,或傳回 null 以取消變更。 |
| config | FieldTextInputConfig | (選用) 用來設定欄位的選項對應。如需這個參數支援的屬性清單,請參閱 [欄位建立說明文件]https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/text-input#creation。 |