天天看點

uniapp常用提示框

1:成功提示

uni.showToast({
title: '送出成功',
duration: 2000
});      

2:加載框

uni.showLoading({
                        title: '加載中'
                    });
                    
                    setTimeout(function () {
                        uni.hideLoading();
                    }, 2000);      

3:去掉圖示,隻顯示文字

uni.showToast({
title: '請填寫員工工号',
icon:'none',
duration: 2000
});      

4:模态彈窗

uni.showModal({
                        title: '提示',
                        content: '這是一個模态彈窗',
                        success: function (res) {
                            if (res.confirm) {
                                console.log('使用者點選确定');
                            } else if (res.cancel) {
                                console.log('使用者點選取消');
                            }
                        }
                    });