fix ApexCharts

This commit is contained in:
jxxghp
2025-01-19 14:31:51 +08:00
parent 615ce34a72
commit d523790c0f
7 changed files with 83 additions and 57 deletions
+7 -1
View File
@@ -23,6 +23,8 @@ const variableTheme = controlledComputed(
() => vuetifyTheme.current.value.variables,
)
const chartKey = ref(0)
// 定时器
let refreshTimer: NodeJS.Timeout | null = null
@@ -129,6 +131,10 @@ onUnmounted(() => {
refreshTimer = null
}
})
onActivated(() => {
chartKey.value += 1
})
</script>
<template>
@@ -142,7 +148,7 @@ onUnmounted(() => {
<VCardTitle>CPU</VCardTitle>
</VCardItem>
<VCardText>
<VApexChart type="line" :options="chartOptions" :series="series" :height="150" />
<VApexChart :key="chartKey" type="line" :options="chartOptions" :series="series" :height="150" />
<p class="text-center font-weight-medium mb-0">当前{{ current }}%</p>
</VCardText>
</VCard>
+7 -1
View File
@@ -24,6 +24,8 @@ const variableTheme = controlledComputed(
() => vuetifyTheme.current.value.variables,
)
const chartKey = ref(0)
// 定时器
let refreshTimer: NodeJS.Timeout | null = null
@@ -135,6 +137,10 @@ onUnmounted(() => {
refreshTimer = null
}
})
onActivated(() => {
chartKey.value += 1
})
</script>
<template>
@@ -148,7 +154,7 @@ onUnmounted(() => {
<VCardTitle>内存</VCardTitle>
</VCardItem>
<VCardText>
<VApexChart type="area" :options="chartOptions" :series="series" :height="150" />
<VApexChart :key="chartKey" type="area" :options="chartOptions" :series="series" :height="150" />
<p class="text-center font-weight-medium mb-0">当前{{ formatBytes(usedMemory) }}</p>
</VCardText>
</VCard>