Skip to content

Commit

Permalink
fix: decimal places error and data table key error
Browse files Browse the repository at this point in the history
  • Loading branch information
Clarivy committed Jun 29, 2024
1 parent 1c2944e commit 25a2775
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
15 changes: 12 additions & 3 deletions src/composables/reward/useRewardRank.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions src/views/Ranking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:headers="headers"
:items="rankList"
:items-per-page="adoptiveItemCount"
item-key="nick_name"
item-key="index"
:loading="status.loading"
></v-data-table>
</v-card>
Expand All @@ -22,7 +22,6 @@ export default {
setup() {
const { status, rankList, headers } = useRewardRank();
rankList.value.sort();
console.log(rankList.value);
return { status, rankList, headers };
},
computed: {
Expand Down

0 comments on commit 25a2775

Please sign in to comment.