uni-app弹窗
API说明uni.showToast显示提示框uni.showLoading显示加载提示框uni.showModal显示模态弹窗uni.showToast(OBJECT)显示消息提示框。uni.showToast({title: '标题',duration: 2000});uni.showLoading(OBJECT)显示 loading 提示框, 需主动调用uni.hideLoading才能关闭
·
| API | 说明 |
| uni.showToast | 显示提示框 |
| uni.showLoading | 显示加载提示框 |
| uni.showModal | 显示模态弹窗 |
uni.showToast(OBJECT)
显示消息提示框。
uni.showToast({
title: '标题',
duration: 2000
});
uni.showLoading(OBJECT)
显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。
uni.showLoading({
title: '加载中'
});
uni.showModal(OBJECT)
显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。
uni.showModal({
title: '提示',
content: '这是一个模态弹窗',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
更多推荐



所有评论(0)