<script type="text/javascript" charset="utf-8">
//mui初始化
mui.init({
swipeBack: true //啟用右滑關(guān)閉功能
});
var info = document.getElementById("info");
document.getElementById("alertBtn").addEventListener('tap', function() {
mui.alert('歡迎使用Hello MUI', 'Hello MUI', function() {
info.innerText = '你剛關(guān)閉了警告框';
});
});
document.getElementById("confirmBtn").addEventListener('tap', function() {
var btnArray = ['否', '是'];
mui.confirm('MUI是個(gè)好框架,確認(rèn)?', 'Hello MUI', btnArray, function(e) {
if (e.index == 1) {
info.innerText = '你剛確認(rèn)MUI是個(gè)好框架';
} else {
info.innerText = 'MUI沒(méi)有得到你的認(rèn)可,繼續(xù)加油'
}
})
});
document.getElementById("promptBtn").addEventListener('tap', function(e) {
e.detail.gesture.preventDefault(); //修復(fù)iOS 8.x平臺(tái)存在的bug,使用plus.nativeUI.prompt會(huì)造成輸入法閃一下又沒(méi)了
var btnArray = ['取消', '確定'];
mui.prompt('請(qǐng)輸入你對(duì)MUI的評(píng)語(yǔ):', '性能好', 'Hello MUI', btnArray, function(e) {
if (e.index == 1) {
info.innerText = '謝謝你的評(píng)語(yǔ):' + e.value;
} else {
info.innerText = '你點(diǎn)了取消按鈕';
}
})
});
document.getElementById("toastBtn").addEventListener('tap', function() {
mui.toast('歡迎體驗(yàn)Hello MUI');
});
</script>
【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!