diff --git a/src/composables/reward/useRewardRank.js b/src/composables/reward/useRewardRank.js index acd14af..7e1f4d4 100644 --- a/src/composables/reward/useRewardRank.js +++ b/src/composables/reward/useRewardRank.js @@ -46,11 +46,20 @@ export default () => { }); useWatching(data, () => { if (data.value) { - rankList.value = data.value.data.map((item) => { + rankList.value = data.value.data.map((item, index) => { if (!item.is_anonymous) { - return item; + return { + ...item, + reward: item.reward / 100, + index: index, + }; } else { - return { ...item, nick_name: '匿名用户' }; + return { + ...item, + reward: item.reward / 100, + nick_name: '匿名用户', + index: index, + }; } }); rankList.value.sort(sortFunc); diff --git a/src/views/Ranking.vue b/src/views/Ranking.vue index 6091379..d8cff6e 100644 --- a/src/views/Ranking.vue +++ b/src/views/Ranking.vue @@ -9,7 +9,7 @@ :headers="headers" :items="rankList" :items-per-page="adoptiveItemCount" - item-key="nick_name" + item-key="index" :loading="status.loading" > @@ -22,7 +22,6 @@ export default { setup() { const { status, rankList, headers } = useRewardRank(); rankList.value.sort(); - console.log(rankList.value); return { status, rankList, headers }; }, computed: {