Home  >  Article  >  Web Front-end  >  How to use loading component to display loading animation in WeChat applet

How to use loading component to display loading animation in WeChat applet

亚连
亚连Original
2018-06-21 17:49:312240browse

This article mainly introduces the usage of WeChat applet loading component to display loading animation, and analyzes the related event operations and attribute setting skills of loading component to display loading animation in the form of examples. It also comes with source code for readers to download and refer to. If needed Friends can refer to

. The example in this article describes the usage of the WeChat applet loading component to display loading animation. Share it with everyone for your reference, as follows:

Key code

① index.wxml

<loading hidden="{{loadingHidden}}">
 加载中...
</loading>
<button type="default" bindtap="loadingTap">点击弹出loading</button>

② index.js

Page({
  data: {
    loadingHidden: true
  },
  loadingTap: function(){
    this.setData({
     loadingHidden: false
    });
    var that = this;
    setTimeout(function(){
     that.setData({
       loadingHidden: true
     });
     that.update();
    }, 3000);
  }
})

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

How to implement seamless scrolling components using vue

How to implement flux on knockoutjs

How to build a universal front-end data simulation framework (detailed tutorial)

How to implement a series of functions such as image uploading in the WeChat applet

About automated builds in Webpack (detailed tutorial)

About null and false values ​​in javaScript

BUG encountered in JavaScript

How to implement page jump and value transfer in WeChat applet

The above is the detailed content of How to use loading component to display loading animation in WeChat applet. For more information, please follow other related articles on the PHP Chinese website!

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