小程序顯示 loading 提示框wx.showLoading
wx.showLoading(Object object)
顯示 loading 提示框。需主動調用 wx.hideLoading 才能關閉提示框
參數
Object object
屬性 類型 默認值 必填 說明
title string 是 提示的內容
mask boolean false 否 是否顯示透明蒙層,防止觸摸穿透
success function 否 接口調用成功的回調函數
fail function 否 接口調用失敗的回調函數
complete function 否 接口調用結束的回調函數(調用成功、失敗都會執行)
示例代碼
wx.showLoading({
title: '加載中',
})
setTimeout(function () {
wx.hideLoading()
}, 2000)