blockly > 变量 > promptName
Variables.promptName() 函数
提示用户输入新的变量名称。
Signature:
export declare function promptName(promptText: string, defaultText: string, callback: (p1: string | null) => void): void;
参数
参数 | 类型 | 说明 |
---|---|---|
promptText | string | 提示的字符串。 |
defaultText | string | 要在提示字段中显示的默认值。 |
callback | (p1: string | null) => void | 回调。系统会向该变量传递新的变量名称;如果用户选择了非法变量,则为 null。 |
返回:
void