新做uni项目,记录一下常用的方法
官方参考文档:https://uniapp.dcloud.io/api/ui/prompt?id=showtoast
1:成功提示
提交表单的时候,如果提交成功

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

uniapp常用提示框uni.showToast(OBJECT)
2:加载框

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

uniapp常用提示框uni.showToast(OBJECT)
3:去掉图标,只显示文字

uni.showToast({
title: '请填写员工工号',
icon:'none',
duration: 2000
});

uniapp常用提示框uni.showToast(OBJECT)
4:模态弹窗

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

uniapp常用提示框uni.showToast(OBJECT)

相关文章:

  • 2022-12-23
  • 2021-06-13
  • 2022-12-23
  • 2021-07-10
  • 2021-07-08
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2021-04-12
  • 2022-12-23
  • 2021-11-08
  • 2021-08-15
  • 2021-04-02
相关资源
相似解决方案