Skip to content

Commit 9750f0e

Browse files
committed
fix: reverse date and display bug
1 parent 820574a commit 9750f0e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

live-demo/app/custom/Dashboard.vue

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,17 @@ const apartsCountsByDaysChart = computed(() => {
188188
});
189189
190190
const listedVsUnlistedPriceByDays = computed(() => {
191-
return data.value.listedVsUnlistedPriceByDays?.map(
192-
(item) => ({
193-
x: dayjs(item.day).format('DD MMM'),
194-
listedPrice: item.listedPrice.toFixed(2),
195-
unlistedPrice: item.unlistedPrice.toFixed(2),
196-
})
197-
);
191+
const arr = data.value?.listedVsUnlistedPriceByDays;
192+
193+
if (!Array.isArray(arr)) return [];
194+
195+
const reversed = arr.slice().reverse();
196+
197+
return reversed.map(item => ({
198+
x: dayjs(item.day).format('DD MMM'),
199+
listedPrice: item.listedPrice.toFixed(2),
200+
unlistedPrice: item.unlistedPrice.toFixed(2),
201+
}));
198202
});
199203
200204
const listedVsUnlistedCountByDays = computed(() => {

0 commit comments

Comments
 (0)