🐛 修复数据 NAN

This commit is contained in:
目棃
2024-08-11 19:12:39 +08:00
parent 199935f0f9
commit 46214a6d64

View File

@@ -63,8 +63,8 @@ onMounted(async () => {
is_over: voteResult.is_over,
data: voteInfo.vote_option_indexes.map((item, index) => ({
title: item,
count: voteResult.option_stats[index],
percent: (voteResult.option_stats[index] / voteResult.user_cnt) * 100,
count: voteResult.option_stats[index] ?? 0,
percent: ((voteResult.option_stats[index] ?? 0) / voteResult.user_cnt) * 100,
})),
};
});