直播系統程式碼,三種常見的提示彈窗

zhibo系統開發發表於2022-03-18

直播系統程式碼,三種常見的提示彈窗實現的相關程式碼

函式定義

function alert(message?: any): void
function confirm(message?: string): boolean
function prompt(message?: string, _default?: string): string

1、提示框 alert

// 沒有返回值
alert('你好');

2、確認框 confirm

// 返回 false/true
let res = confirm('確定刪除?');
console.log(res);

3、輸入框 prompt

// 返回使用者輸入的值或null, 第二個值為指定的預設值(可選)
var ret = prompt('請輸入您的年齡', 23);
console.log(ret);

以上就是直播系統程式碼,三種常見的提示彈窗實現的相關程式碼,更多內容歡迎關注之後的文章


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69978258/viewspace-2872484/,如需轉載,請註明出處,否則將追究法律責任。

相關文章