add player info (WIP)

This commit is contained in:
2023-03-29 12:54:20 +02:00
parent 84f2457f79
commit 6e8a430f7e
3 changed files with 65 additions and 7 deletions
+46
View File
@@ -0,0 +1,46 @@
<template>
<div id="playerInfo">{{playerWeapons}}</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { Player, Weapon } from '@/store/index'
import { useStore } from 'vuex'
export default defineComponent({
props: {
filters: Object,
playerHighlighted: String
},
emits: ['highlightPlayer'],
data () {
return {
sortingData: { direction: -1, argument: 'kills' as keyof Player | 'k/d' },
store: useStore()
}
},
computed: {
players (): { [key: string]: Player } { return this.store.getters.getPlayerList(this.filters) },
player ():Player | undefined {
if (!this.playerHighlighted) return
if (!this.players) return
return this.players[this.playerHighlighted]
},
playerWeapons (): { [key: string]: Weapon } {
return this.store.getters.getWeaponList({ player: this.playerHighlighted, ...this.filters })
}
},
watch: {
},
methods: {
}
})
</script>
<style scoped>
#playerInfo{
grid-area: info;
}
</style>
+1
View File
@@ -142,6 +142,7 @@ export default defineComponent({
}
.playerTable {
grid-area: list;
margin-right: 1rem;
overflow: auto;
height: 100%;