ts_aimz/components/container-loading/container-loading.js

53 lines
1.2 KiB
JavaScript
Raw Normal View History

2025-03-24 18:05:54 +08:00
// components/container-loading/container-loading.js
Component({
/**
* 组件的属性列表
*/
properties: {
loadingState: {
type: String,
value: 'loading'
2025-03-26 18:15:07 +08:00
},
widgetHeight: {
type: Number,
value: 200
2025-03-24 18:05:54 +08:00
}
},
observers: {
'loadingState': function (newVal) {
this.setData({
loadingVisible: newVal
});
2025-03-26 18:15:07 +08:00
},
'widgetHeight': function (newVal) {
this.setData({
height: newVal
})
2025-03-24 18:05:54 +08:00
}
},
data: {
2025-03-26 18:15:07 +08:00
loadingVisible: 'loading',
height: 200,
localAssets: ''
},
lifetimes: {
attached() {
const app = getApp()
this.setData({
localAssets: app.globalData.localAssets
})
}
2025-03-24 18:05:54 +08:00
},
/**
* 组件的方法列表
*/
2025-04-03 10:44:12 +08:00
methods: {
notifyParentToRefresh() {
// 触发自定义事件 'parentRefresh',并可以传递数据(这里传递一个空对象)
this.triggerEvent('refresh', {});
2025-04-25 17:37:14 +08:00
},
notifyParentCreate() {
this.triggerEvent('create', {})
2025-04-03 10:44:12 +08:00
}
}
2025-03-24 18:05:54 +08:00
})