mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
fix ApexCharts
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user