微信小程序 loading 详解及实例代码

网络编程 2021-07-04 19:19www.168986.cn编程入门
这篇文章主要介绍了微信小程序 loading 详解及实例代码的相关资料,需要的朋友可以参考下

微信小程序 开发文档,相关文章:


微信小程序 loading

属性名 类型 默认值 说明
hidden Boolean false 是否隐藏

示例代码:

<view class="body-view">
 <loading hidden="{{hidden}}">
  加载中...
 </loading>
 <button type="default" bindtap="loadingTap">点击弹出loading</button>
</view>
Page({
 data: {
  hidden: true
 },
 loadingTap: function(){
  this.setData({
   hidden: false
  });
  var that = this;
  setTimeout(function(){
   that.setData({
    hidden: true
   });
   that.update();
  }, 3000);
 }
})

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

Copyright © 2016-2025 www.168986.cn 狼蚁网络 版权所有 Power by