Home  >  Article  >  WeChat Applet  >  WeChat applet loading detailed explanation and example code

WeChat applet loading detailed explanation and example code

高洛峰
高洛峰Original
2017-02-13 10:48:401799browse

This article mainly introduces the detailed explanation and example code of WeChat applet loading. Friends in need can refer to it

WeChat applet loading


Attribute name Type Default value Description
hidden Boolean false Whether to hide

Sample code:

<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);
 }
})

Thank you for reading, I hope it can help everyone, thank you for your support of this site support!

For more WeChat applet loading, please pay attention to the PHP Chinese website for detailed explanations and sample code related articles!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn