uni.showToast(OBJECT)

显示消息提示框

OBJECT参数说明

参数 类型 必填 说明 平台支持
title String 提示的内容 all
icon String 图标,有效值 "success", "loading" u?,w,a
image String 自定义图标的本地路径,image 的优先级高于 icon u?,w,a
duration Number 提示的延迟时间,单位毫秒,默认:1500 all
mask Boolean 是否显示透明蒙层,防止触摸穿透,默认:false u?,w,a
success Function 接口调用成功的回调函数 u?,w,a
fail Function 接口调用失败的回调函数 u?,w,a
complete Function 接口调用结束的回调函数(调用成功、失败都会执行) u?,w,a

示例

uni.showToast({
  title: '成功',
  icon: 'success',
  duration: 2000
})

results matching ""

    No results matching ""