Skip to content

Commit

Permalink
🐛 修复数据 NAN
Browse files Browse the repository at this point in the history
  • Loading branch information
BTMuli committed Aug 11, 2024
1 parent 199935f commit 46214a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/post/tp-vote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})),
};
});
Expand Down

0 comments on commit 46214a6

Please sign in to comment.