bugfix: fix sorting of players by score in highscore table
This commit is contained in:
parent
5c2b99a909
commit
376a9f5642
@ -20,14 +20,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { computed } from 'vue'
|
||||||
import { usePlayersStore } from '@/stores/PlayersStore'
|
import { usePlayersStore } from '@/stores/PlayersStore'
|
||||||
import { useGameinfoStore } from "@/stores/GameinfoStore"
|
import { useGameinfoStore } from "@/stores/GameinfoStore"
|
||||||
|
|
||||||
const title = useGameinfoStore().gameInfo.name
|
const title = useGameinfoStore().gameInfo.name
|
||||||
const players = usePlayersStore().players
|
const players = computed(() => {
|
||||||
players.sort((a, b) => {
|
const p = usePlayersStore().players
|
||||||
|
p.sort((a, b) => {
|
||||||
return b.score - a.score
|
return b.score - a.score
|
||||||
})
|
})
|
||||||
|
return p
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
Loading…
Reference in New Issue
Block a user