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

This commit is contained in:
TsMask committed 2024-10-11 14:12:57 +08:00
1 parent 5edcee8da5
commit 30849416b6
2 files changed
+6

No files matched your search

+3
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>
+3
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>