show no data in trend card when there are really no data in recent 6 months

This commit is contained in:
MaysWind
2023-07-30 23:57:47 +08:00
parent a20958a89b
commit 5b52c1adbb
2 changed files with 34 additions and 3 deletions
+6 -2
View File
@@ -103,8 +103,8 @@
</v-col>
<v-col cols="12" md="6">
<monthly-income-and-expense-card :data="monthlyIncomeAndExpenseData"
:disabled="loadingOverview" :is-dark-mode="isDarkMode" />
<monthly-income-and-expense-card :data="monthlyIncomeAndExpenseData" :is-dark-mode="isDarkMode"
:loading="loadingOverview" :disabled="loadingOverview" />
</v-col>
</v-row>
@@ -207,6 +207,10 @@ export default {
const self = this;
const data = [];
if (!self.transactionOverview || !self.transactionOverview.thisMonth || !self.transactionOverview.thisMonth.valid) {
return data;
}
[ 'monthBeforeLast4Months', 'monthBeforeLast3Months', 'monthBeforeLast2Months', 'monthBeforeLastMonth', 'lastMonth', 'thisMonth' ].forEach(fieldName => {
if (!Object.prototype.hasOwnProperty.call(self.transactionOverview, fieldName)) {
return;