uniapp 提示框(showToast、showModal、showLoading)

一、showToast

uni.showToast({
	title: '没有更多了',//标题 必填
	icon: 'none',//图标
    image: '',//自定义图标的本地路径(app端暂不支持gif)
    mask: true,//是否显示透明蒙层,防止触摸穿透,默认:false
    duration: '',//提示的延迟时间,单位毫秒,默认:1500
    position: '',//纯文本轻提示显示位置,填写有效值后只有 title 属性生效,且不支持通过         uni.hideToast 隐藏。有效值详见下方说明。	App
    success: '',//接口调用成功的回调函数	
    fail: '',//接口调用失败的回调函数	
    complete: '',//接口调用结束的回调函数(调用成功、失败都会执行)
});

二、showModal

uni.showModal({
	title: '提示',
	content: '这是一个模态弹窗',
	success: function (res) {
		if (res.confirm) {
			console.log('用户点击确定');
		} else if (res.cancel) {
			console.log('用户点击取消');
		}
	}
});

三、showLoading 和 hideLoading

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

转载于 uniapp 提示框(showToast、showModal、showLoading)

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值