更新时间:2020/8/28 下午3:15:32
更新说明:为兼容低端安卓机增加了flex的样式
display:-webkit-box; display:-webkit-flex; display:-moz-box; display:-ms-flexbox; display:flex; -webkit-box-pack:center; -webkit-justify-content:center; -moz-box-pack:center; -ms-flex-pack:center; justify-content:center; -webkit-box-align:center; -webkit-align-items:center; -moz-box-align:center; -ms-flex-align:center;align-items:center;
基于promise实现
调用方式如下
alert('请打开麦克风').then(() => {
console.log('已确认')
})
confirm('请打开麦克风').then(() => {
console.log('已确认')
}).catch(() => {
console.log('已取消')
})
toast('请打开麦克风')