toast

2022-06-13 15:23 更新

弹出一个定时自动关闭的提示框

toast({params})

params

msg:

  • 类型:字符串
  • 默认值:无
  • 描述:提示消息

duration:

  • 类型:数字
  • 默认值:2000
  • 描述:(可选项)持续时长,单位:毫秒

location:

  • 类型:字符串
  • 默认值:bottom
  • 描述:(可选项)弹出位置,顶部、中间或底部
  • 取值范围:

top         //顶部
middle      //中间
bottom      //底部

global:

  • 类型:布尔
  • 默认值:false
  • 描述:(可选项)是否是全局的toast。若为false,toast将只在当前window范围可见;若为true,安卓手机上面弹出的位置将会固定在底部区域。

示例代码

api.toast({
    msg: '网络错误',
    duration: 2000,
    location: 'bottom'
});

可用性

iOS系统,Android系统

可提供的1.0.0及更高版本

以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号