Add champions feat

This commit is contained in:
Blossomi Shymae
2024-05-01 21:56:30 -05:00
parent cab1684b7c
commit 32b961dd32
9 changed files with 217 additions and 83 deletions

44
pages/champions/index.vue Normal file
View File

@@ -0,0 +1,44 @@
<template>
<div class="d-flex flex-column gap-2">
<h1>Champions</h1>
<div class="overflow-hidden rounded border border-light border-opacity-25 p-4">
<table class="sortable table table-borderless">
<thead>
<tr>
<th scope="col">Id</th>
<th scope="col">Icon</th>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
<tr v-for="summary in summaries" :key="summary.id">
<th scope="row">
<NuxtLink class="text-decoration-none text-light" :to="`/champions/overview/${summary.id}`">
{{ summary.id }}
</NuxtLink>
</th>
<td>
<NuxtLink :to="`/champions/overview/${summary.id}`">
<img :src="summary.getIcon({locale: 'default', version: 'latest'})" width="32px" height="32px" loading="lazy" onerror="this.onerror = null; this.src='/img/error.png'"/>
</NuxtLink>
</td>
<td>
<NuxtLink class="text-decoration-none text-light" :to="`/champions/overview/${summary.id}`">
{{ summary.name }}
</NuxtLink>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script setup lang="ts">
import useClient from '../../composables/useClient';
const { client } = useClient();
const summaries = await client.championSummaries.listAsync({locale: "default", version: "latest"});
</script>