Skip to main content
Version: 1.x

Taro.showLoading(OBJECT)

显示 Loading 提示框, 需主动调用 Taro.hideLoading 才能关闭提示框,支持 Promise 化使用。

OBJECT 参数说明:

参数类型必填说明
titleString提示的内容
maskBoolean是否显示透明蒙层,防止触摸穿透,默认:false
successFunction接口调用成功的回调函数
failFunction接口调用失败的回调函数
completeFunction接口调用结束的回调函数(调用成功、失败都会执行)

示例代码

import Taro from '@tarojs/taro'

Taro.showLoading({
title: 'loading'
})
.then(res => console.log(res))

API支持度

API微信小程序H5React Native
Taro.showLoading✔️✔️✔️