微信小程序 loading 组件实例详解

高洛峰
Libérer: 2017-02-17 10:33:10
original
2185 Les gens l'ont consulté

这篇文章主要介绍了微信小程序 loading 组件实例详解的相关资料,需要的朋友可以参考下

微信小程序 loading 组件实例详解

loading通常使用在请求网络数据时的一种方式,通过hidden属性设置显示与否

主要属性:

微信小程序 loading 组件实例详解

wxml

<!---->
<button type="primary" bindtap="listenerButton">显示loading</button>
<!--默认隐藏-->
<loading hidden="{{hiddenLoading}}">正在加载</loading>
Copier après la connexion

js

Page({
 data:{
 // text:"这是一个页面"
 hiddenLoading: true
 },

 /**
 * 监听button点击事件
 */
 listenerButton:function(){
 this.setData({
  hiddenLoading: !this.data.hiddenLoading
 })
 },
 onLoad:function(options){
 // 页面初始化 options为页面跳转所带来的参数
 },
 onReady:function(){
 // 页面渲染完成
 },
 onShow:function(){
 // 页面显示
 },
 onHide:function(){
 // 页面隐藏
 },
 onUnload:function(){
 // 页面关闭
 }
})
Copier après la connexion

更多微信小程序 loading 组件实例详解相关文章请关注PHP中文网!

Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!