ts_aimz_uni/wxcomponents/container-loading/container-loading.js
itgaojian163 3c9e0c3f08 初始化
2025-04-16 16:15:41 +08:00

42 lines
939 B
JavaScript

// components/container-loading/container-loading.js
Component({
/**
* 组件的属性列表
*/
properties: {
loadingState: {
type: String,
value: 'loading'
},
widgetHeight: {
type: Number,
value: 200
}
},
observers: {
'loadingState': function (newVal) {
this.setData({
loadingVisible: newVal
});
},
'widgetHeight': function (newVal) {
this.setData({
height: newVal
})
}
},
data: {
loadingVisible: 'loading',
height: 200
},
/**
* 组件的方法列表
*/
methods: {
notifyParentToRefresh() {
// 触发自定义事件 'parentRefresh',并可以传递数据(这里传递一个空对象)
this.triggerEvent('refresh', {});
}
}
})