Skip to content

mpx.showLoading(Object object)

显示 loading 提示框。需主动调用 mpx.hideLoading 才能关闭提示框

支持情况: 微信、支付宝、web、RN

参考文档

参数

Object object

属性类型默认值必填说明
titlestring提示的内容
maskbooleanfalse是否显示透明蒙层,防止触摸穿透
successfunction接口调用成功的回调函数
failfunction接口调用失败的回调函数
completefunction接口调用结束的回调函数(调用成功、失败都会执行)

示例代码

js
mpx.showLoading({
  title: '加载中',
})

setTimeout(function () {
  mpx.hideLoading()
}, 2000)