uni-app 提示框

39 篇文章 17 订阅 ¥19.90 ¥99.00
5 篇文章 2 订阅

uni-app官网提供的两种显示方式:

第一种

uni.showToast


/*
    title    {string}     提示的内容,长度与 icon 取值有关。

    icon     {string}     图标

    image    {string}     自定义图标的本地路径

    mask     {boolean}    遮罩层

    duration {number}     持续时间 默认1500

    position {string}     显示位置   'top','center','bottom'

    success  {function}   成功的回调

    fail     {function}   失败的回调

    complete {function}   结束的回调
 
*/


uni.showToast({
    title: '标题',
    duration: 2000
});



uni.hideToast(); //隐藏提示框

第二种

uni.showModal


/*
    title        {string}     提示的标题

    content      {string}     提示的内容

    showCancel   {boolean}    是否显示关闭按钮 true

    cancelText   {string}     取消按钮的文字,"取消",最多四个字符

    cancelColor  {HexColor}   取消按钮的文字颜色

    confirmText  {string}     确认按钮的文字,"取消",最多四个字符

    confirmColor {HexColor}   确认按钮的文字颜色
    
    success      {fu
  • 13
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

攻城狮Lee丶

码字不易,客观打个赏吧

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值