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

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

wxml
<!---->
<button type="primary" bindtap="listenerButton">显示loading</button>
<!--默认隐藏-->
<loading hidden="{{hiddenLoading}}">正在加载</loading>
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(){
// 页面关闭
}
})
相关文章:
hello WeApp icon组件
Window text组件 switch组件
tabBar底部导航 progress组件 action-sheet
应用生命周期 button组件 modal组件
页面生命周期 checkbox组件 toast组件
模块化详 form组件详 loading 组件
数据绑定 input 组件 navigator 组件
View组件 picker组件 audio 组件
scroll-view组件 radio组件 video组件
swiper组件 slider组件 Image组件
相关文章
THREE.js添加多个castShadow光源报错解决及原因分析
这篇文章主要介绍了THREE.js添加多个castShadow的光源报错解决及原因分析2023-06-06
基于JavaScript ES新特性let与const关键字
这篇文章主要介绍了基于JavaScript ES新特性let与const关键字,let是ECMAScript 2015新增的一个关键字,用于声明变量,const关键字用于声明一个常量,更多详细内容,请需要的小伙伴参考下面文章的介绍,希望对你有所帮助2021-12-12


最新评论