uni-app几种常用的提示框
uni-app几种常用的提示框1、成功提示框提交的时候,提交成功弹出的提示框。uni.showToast({title: '提交成功',duration: 3000//单位毫秒});2、加载框uni.showLoading({title: '加载中'});setTimeout(function () {uni.hideLoading();}, 2000);3、去掉图标,只显示文字提示框uni.sh
·
uni-app几种常用的提示框
1、成功提示框
提交的时候,提交成功弹出的提示框。
uni.showToast({
title: '提交成功',
duration: 3000//单位毫秒
});

2、加载框
uni.showLoading({
title: '加载中'
});
setTimeout(function () {
uni.hideLoading();
}, 2000);

3、去掉图标,只显示文字提示框
uni.showToast({
title: '请填写员工工号',
icon:'none',
duration: 2000
});

4、模态弹窗
uni.showModal({
title: '警告',
content: '注销账号会清除账号下的所有数据!您确认要注销吗?',
cancelText: "考虑一下", // 取消按钮的文字
confirmText: "确认删除", // 确认按钮文字
confirmColor:'#F54E40',//确认字体的颜色
cancelColor:'#000',//取消字体的颜色
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});

更多推荐



所有评论(0)