fix: 工具ps/net页面定时器清除

This commit is contained in:
TsMask
2024-10-11 14:12:57 +08:00
parent 5edcee8da5
commit 30849416b6
2 changed files with 6 additions and 0 deletions

View File

@@ -78,6 +78,7 @@ function fnRealTime(reLink: boolean) {
/**调度器周期变更*/
function fnIntervalChange(v: any) {
clearInterval(state.interval);
state.interval = null;
const timer = parseInt(v);
if (timer > 1_000) {
state.intervalTime = v;
@@ -232,6 +233,8 @@ onMounted(() => {
/**钩子函数,界面关闭*/
onBeforeUnmount(() => {
clearInterval(state.interval);
state.interval = null;
ws.close();
});
</script>

View File

@@ -80,6 +80,7 @@ function fnRealTime(reLink: boolean) {
/**调度器周期变更*/
function fnIntervalChange(v: any) {
clearInterval(state.interval);
state.interval = null;
const timer = parseInt(v);
if (timer > 1_000) {
state.intervalTime = v;
@@ -265,6 +266,8 @@ onMounted(() => {
/**钩子函数,界面关闭*/
onBeforeUnmount(() => {
clearInterval(state.interval);
state.interval = null;
ws.close();
});
</script>