Home > SYS_Dialog > showInputDialog
SYS_Dialog.showInputDialog() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
弹出输入窗口
Signature
showInputDialog(beforeContent?: string, afterContent?: string, title?: string, type?: 'color' | 'date' | 'datetime-local' | 'email' | 'mouth' | 'number' | 'password' | 'tel' | 'text' | 'time' | 'url' | 'week', value?: string | number, otherProperty?: {
max?: number;
maxlength?: number;
min?: number;
minlength?: number;
multiple?: boolean;
pattern?: RegExp;
placeholder?: string;
readonly?: boolean;
step?: number;
}, callbackFn?: (value: any) => void): void;
2
3
4
5
6
7
8
9
10
11
Parameters
Parameter | Type | Description |
---|---|---|
beforeContent | string | (Optional) 输入框上方文字 |
afterContent | string | (Optional) 输入框下方文字 |
title | string | (Optional) 弹出窗口标题 |
type | 'color' | 'date' | 'datetime-local' | 'email' | 'mouth' | 'number' | 'password' | 'tel' | 'text' | 'time' | 'url' | 'week' | (Optional) 输入框类型 |
value | string | number | (Optional) 输入框默认值 |
otherProperty | { max?: number; maxlength?: number; min?: number; minlength?: number; multiple?: boolean; pattern?: RegExp; placeholder?: string; readonly?: boolean; step?: number; } | (Optional) 其它参数,可参考 The HTML Input element |
callbackFn | (value: any) => void | (Optional) 回调函数 |
Returns
void
用户输入的值,始终为 string
类型,除非用户点击了 **取消** 按钮