46 lines
1.3 KiB
Vue
46 lines
1.3 KiB
Vue
<script setup>
|
|
const props = defineProps({
|
|
championId: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
winrate: {
|
|
type: Number,
|
|
required: true
|
|
},
|
|
pickrate: {
|
|
type: Number,
|
|
required: true
|
|
},
|
|
gameCount: {
|
|
type: Number,
|
|
required: true
|
|
}
|
|
})
|
|
|
|
const championId = Number(props.championId)
|
|
|
|
const winrate = (props.winrate * 100).toFixed(2)
|
|
const pickrate = (props.pickrate * 100).toFixed(2)
|
|
const gameCount = props.gameCount
|
|
|
|
const { data: championData } = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champions/" + championId + ".json")
|
|
const championName = championData.value.name
|
|
const championDescription = championData.value.title
|
|
|
|
</script>
|
|
|
|
<template>
|
|
<div style="display: flex;">
|
|
<NuxtImg width="160" height="160" :src="CDRAGON_BASE + 'plugins/rcp-be-lol-game-data/global/default/v1/champion-icons/' + championId + '.png'"/>
|
|
<div style="margin-left: 15px; margin-top: 5px;">
|
|
<h1>{{ championName }}</h1>
|
|
<h3 style="margin-top: 5px">{{ championDescription }}</h3>
|
|
<div style="margin-top: 30px; display: flex;">
|
|
<h2>{{ winrate }}% win.</h2>
|
|
<h2 style="margin-left: 20px; margin-right: 20px;">{{ pickrate }}% pick.</h2>
|
|
<h2>{{ gameCount }} games</h2>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template> |