Browse Source

页面离开清除定时器

znjjxt
lzp 3 months ago
parent
commit
c56363d759
  1. 9
      pages/index/index.vue

9
pages/index/index.vue

@ -407,13 +407,16 @@ export default {
this.handleLogin(); this.handleLogin();
}, },
onShow() { onShow() {
console.log("this.falt", this.falt);
if (this.falt) { if (this.falt) {
this.getAttributes(this.deviceId); // id this.getAttributes(this.deviceId); // id
} }
}, },
// //
onUnload() { onHide() {
clearTimeout(this.timer); console.log("页面即将卸载2");
clearTimeout(this.timer); //
}, },
}; };
</script> </script>

Loading…
Cancel
Save