dialog.prompt() 函式
應用程式開發人員可透過 setPrompt 覆寫 window.prompt() 的包裝函式,提供模式瀏覽器視窗的替代方案。內建的瀏覽器提示通常用於改善行動裝置上的文字輸入體驗。強烈建議您在覆寫此值時測試行動裝置。
Signature:
export declare function prompt(message: string, defaultValue: string, callback: (result: string | null) => void): void;
參數
| 參數 | 類型 | 說明 |
|---|---|---|
| 訊息 | 字串 | 要向使用者顯示的訊息。 |
| defaultValue | 字串 | 用來初始化提示的值。 |
| callback | (result: string | null) => void | 用於處理使用者回應的回呼。 |
退貨:
void