- [Loading - 指示器]
- [Dialog - 对话框]
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(){
// 页面关闭
}
})
Dialog - 对话框
本文介绍了微信小程序中加载指示器(loading)和对话框(dialog)的使用方法。加载指示器通常用于网络请求过程中的加载提示,可通过hidden属性控制显示与隐藏。同时,文章提供了示例代码展示如何在按钮点击事件中切换加载指示器的状态。
1万+

被折叠的 条评论
为什么被折叠?



