fix
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<!-- 支出分类统计 -->
|
||||
<div
|
||||
class="common-card"
|
||||
style="padding-bottom: 10px;"
|
||||
style="padding-bottom: 10px"
|
||||
>
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">
|
||||
@@ -255,11 +255,15 @@ const renderPieChart = () => {
|
||||
}
|
||||
|
||||
// 监听数据变化重新渲染图表
|
||||
watch(() => [props.categories, props.totalExpense, props.colors], () => {
|
||||
nextTick(() => {
|
||||
renderPieChart()
|
||||
})
|
||||
}, { deep: true, immediate: true })
|
||||
watch(
|
||||
() => [props.categories, props.totalExpense, props.colors],
|
||||
() => {
|
||||
nextTick(() => {
|
||||
renderPieChart()
|
||||
})
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
)
|
||||
|
||||
// 组件销毁时清理图表实例
|
||||
onBeforeUnmount(() => {
|
||||
@@ -404,4 +408,4 @@ onBeforeUnmount(() => {
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user