added SprayGraph.vue
All checks were successful
CSGOWTF/csgowtf/pipeline/head This commit looks good

This commit is contained in:
2021-11-07 18:23:12 +01:00
committed by Giovanni Harting
parent a4e0878252
commit 2e456c7920
3 changed files with 103 additions and 26 deletions

View File

@@ -0,0 +1,66 @@
<template>
<div class="details-site">
<div class="multi-kills">
<h3 class="text-center">Multi-Kills</h3>
<MultiKillsChart/>
</div>
<hr>
<div class="spray">
<h3 class="text-center">Spray</h3>
<SprayGraph :spray="data.spray"/>
</div>
</div>
</template>
<script>
import MultiKillsChart from "@/components/MultiKillsChart";
import SprayGraph from "@/components/SprayGraph";
import {useStore} from "vuex";
import {onMounted, reactive} from "vue";
import {GetWeaponDmg} from "@/utils";
export default {
name: "Details",
components: {SprayGraph, MultiKillsChart},
setup() {
const store = useStore()
const data = reactive({
spray: [],
})
const getWeaponDamage = async () => {
const resData = await GetWeaponDmg(store.state.matchDetails.match_id)
data.spray = resData.spray
}
onMounted(() => {
getWeaponDamage()
})
return {data}
}
}
</script>
<style lang="scss" scoped>
.details-site {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
h3 {
margin-bottom: 1rem;
}
hr {
width: 100%;
border: 1px solid white;
}
.multi-kills {
margin-top: 1rem;
}
}
</style>