42 lines
939 B
JavaScript
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', {});
|
||
|
}
|
||
|
}
|
||
|
})
|