一、显示自动消失
uni.showToast({
title: '标题',
duration: 2000
});
二、弹出,点确定关闭(真正的alert)
uni.showModal({
title: '提示',
content: '地区选择出现问题,请重新选择地区',
showCancel: false
});
自己用:
this.$csj.messagebox("ok11");
this.$modal.alert("进入");
三、弹出,需要操作
uni.showModal({
title: '提示',
content: '这是一个模态弹窗',
success: function (res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
本文介绍了uni-app中三种不同类型的弹窗使用方法:自动消失的提示框,仅确认的modal,以及需要用户操作的modal,分别展示了它们的参数配置和响应处理。
5002

被折叠的 条评论
为什么被折叠?



