39 lines
766 B
JavaScript

Component({
externalClasses: ['i-class'],
data: {
loading: false
},
// properties: {
// tip: {
// type: String,
// value: ''
// }
// },
// 在组件实例刚刚被创建时执行
created: function() {
let that = this;
setTimeout(function() {
that.setData({ loading: true })
}, 2000)
},
// 在组件在视图层布局完成后执行
// ready: function() {
// },
pageLifetimes: {
// 页面被展示
show: function() {
let that = this;
setTimeout(function() {
that.setData({ loading: true })
}, 1000)
},
// 页面被隐藏
hide: function() {
this.setData({ loading: false })
},
// 页面尺寸变化
resize: function(size) {
}
}
});