componentsMixin.js
467 Bytes
module.exports = Behavior({
lifetimes: {
attached() {
let componentTimer = setInterval(() => {
let thisPage = wx.$router.getPageInstance()
let {
IMGURL,
img_version
} = thisPage.data
if (IMGURL || img_version) {
this.setData({
IMGURL,
img_version: img_version || '1.0.0'
})
clearInterval(componentTimer)
}
}, 0.25 * 1000)
}
}
})