diff --git a/src/views/devtools/hierarchy.vue b/src/views/devtools/hierarchy.vue index d54edf7..15b0366 100644 --- a/src/views/devtools/hierarchy.vue +++ b/src/views/devtools/hierarchy.vue @@ -116,10 +116,10 @@ export default defineComponent({ Bus.off(BusMsg.ShowPlace, funcShowPlace); Bus.off(BusMsg.EnableSchedule, funcEnableSchedule); bridge.off(Msg.InspectNode, onInspectNode); - timer.clean(); + timer.destroy(); }); function updateTree() { - console.log("update tree info"); + // console.log("update tree info"); const id = toRaw(frameID.value); bridge.send(Msg.RequstTreeInfo, { frameID: id } as RequestTreeInfoData); } diff --git a/src/views/devtools/inspector.vue b/src/views/devtools/inspector.vue index aa96f07..4583a9c 100644 --- a/src/views/devtools/inspector.vue +++ b/src/views/devtools/inspector.vue @@ -84,7 +84,7 @@ export default defineComponent({ Bus.off(BusMsg.ChangeContent, changeContent); Bus.off(BusMsg.SelectNode, funSelectNode); Bus.off(BusMsg.EnableSchedule, funcEnableSchedule); - timer.clean(); + timer.destroy(); }); bridge.on(Msg.ResponseSupport, (event: PluginEvent) => { let data: ResponseSupportData = event.data; diff --git a/src/views/devtools/timer.ts b/src/views/devtools/timer.ts index cc928c4..759a34f 100644 --- a/src/views/devtools/timer.ts +++ b/src/views/devtools/timer.ts @@ -18,12 +18,18 @@ export class Timer { this.onWork && this.onWork(); } } - clean() { + destroy(): boolean { if (this.timer === null) { - return; + return false; + } else { + clearInterval(this.timer); + this.timer = null; + return true; + } + } + clean() { + if (this.destroy()) { + this.onClean && this.onClean(); } - clearInterval(this.timer); - this.timer = null; - this.onClean && this.onClean(); } }