目录
非 VIP 用户可前往公众号“前端基地”进行免费阅读,文章链接如下:微信小程序交互组件:加载、提示及操作菜单 API 指南
wx.showLoading
显示loading提示框
示例代码如下:
showLoading.wxml
<view class="w">
<button type="primary" bindtap="showLoading">显示loading提示框</button>
</view>
showLoading.js
Page({
showLoading(){
wx.showLoading({
title: '加载中...',
})
setTimeout(function(){
wx.hideLoading()
},2000)
}
})
运行结果:
点击“显示loading提示框”按钮,弹出Loading对话框,截图如下:
2S后Loading对话隐藏。
属性介绍:
属性 |
描述 |
title |