updated DamageSite.vue
This commit is contained in:
@@ -11,42 +11,35 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup lang="ts">
|
||||||
import HitgroupPuppet from "/src/components/HitgroupPuppet";
|
import HitgroupPuppet from "@/components/HitgroupPuppet.vue";
|
||||||
import TotalDamage from "/src/components/TotalDamage";
|
import TotalDamage from "@/components/TotalDamage.vue";
|
||||||
import { onMounted, reactive } from "vue";
|
import { onMounted } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { GetWeaponDmg } from "@/utils";
|
||||||
import { GetWeaponDmg } from "/src/utils";
|
import { useMatchDetailsStore } from "@/stores/matchDetails";
|
||||||
|
import type { MatchWeapons } from "@/types";
|
||||||
|
import { useInfoStateStore } from "@/stores/infoState";
|
||||||
|
|
||||||
export default {
|
const data = {} as MatchWeapons;
|
||||||
name: "DamageSite.vue",
|
|
||||||
components: { HitgroupPuppet, TotalDamage },
|
|
||||||
setup() {
|
|
||||||
const store = useStore();
|
|
||||||
|
|
||||||
const data = reactive({
|
const matchDetailsStore = useMatchDetailsStore();
|
||||||
equipment_map: {},
|
const infoStateStore = useInfoStateStore();
|
||||||
stats: [],
|
|
||||||
});
|
|
||||||
|
|
||||||
const getWeaponDamage = async () => {
|
const getWeaponDamage = async () => {
|
||||||
const resData = await GetWeaponDmg(
|
const [resData, info] = await GetWeaponDmg(
|
||||||
store,
|
matchDetailsStore.matchDetails.match_id
|
||||||
store.state.matchDetails.match_id
|
);
|
||||||
);
|
|
||||||
if (resData !== null) {
|
|
||||||
data.equipment_map = resData.equipment_map;
|
|
||||||
data.stats = resData.stats;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
if (info.message !== "") infoStateStore.addInfo(info);
|
||||||
getWeaponDamage();
|
if (resData !== null) {
|
||||||
});
|
data.equipment_map = resData.equipment_map;
|
||||||
|
data.stats = resData.stats;
|
||||||
return { data };
|
}
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getWeaponDamage();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Reference in New Issue
Block a user