微信小程序 loading 組件實例詳解

loading通常使用在請求網(wǎng)絡(luò)數(shù)據(jù)時的一種方式,通過hidden屬性設(shè)置顯示與否
主要屬性:

wxml
<!---->
<button type="primary" bindtap="listenerButton">顯示loading</button>
<!--默認隱藏-->
<loading hidden="{{hiddenLoading}}">正在加載</loading>
js
Page({
data:{
// text:"這是一個頁面"
hiddenLoading: true
},
/**
* 監(jiān)聽button點擊事件
*/
listenerButton:function(){
this.setData({
hiddenLoading: !this.data.hiddenLoading
})
},
onLoad:function(options){
// 頁面初始化 options為頁面跳轉(zhuǎn)所帶來的參數(shù)
},
onReady:function(){
// 頁面渲染完成
},
onShow:function(){
// 頁面顯示
},
onHide:function(){
// 頁面隱藏
},
onUnload:function(){
// 頁面關(guān)閉
}
})
相關(guān)文章:
hello WeApp icon組件
Window text組件 switch組件
tabBar底部導(dǎo)航 progress組件 action-sheet
應(yīng)用生命周期 button組件 modal組件
頁面生命周期 checkbox組件 toast組件
模塊化詳 form組件詳 loading 組件
數(shù)據(jù)綁定 input 組件 navigator 組件
View組件 picker組件 audio 組件
scroll-view組件 radio組件 video組件
swiper組件 slider組件 Image組件
- 微信小程序之MaterialDesign--input組件詳解
- 微信小程序 input輸入框控件詳解及實例(多種示例)
- 微信小程序 input輸入框詳解及簡單實例
- 微信小程序 (十七)input 組件詳細介紹
- 微信小程序picker組件下拉框選擇input輸入框的實例
- 微信小程序中input標簽詳解及簡單實例
- 微信小程序?qū)崿F(xiàn)簡單input正則表達式驗證功能示例
- 微信小程序 input輸入及動態(tài)設(shè)置按鈕的實現(xiàn)
- 微信小程序 input表單與redio及下拉列表的使用實例
- 微信小程序 Button 組件詳解及簡單實例
- 微信小程序使用input組件實現(xiàn)密碼框功能【附源碼下載】
相關(guān)文章
關(guān)于JavaScript輪播圖的實現(xiàn)
這篇文章主要介紹了關(guān)于JavaScript輪播圖的實現(xiàn),下面文章主要是利用利用html 和 css 代碼實現(xiàn)輪播圖,詳細內(nèi)容請參考下面詳細內(nèi)容,希望對你有所幫助2021-11-11
微信小程序 動態(tài)的設(shè)置圖片的高度和寬度詳解及實例代碼
這篇文章主要介紹了微信小程序 動態(tài)的設(shè)置圖片的高度和寬度詳解及實例代碼的相關(guān)資料,需要的朋友可以參考下2017-02-02

