Champions are sorted :)
All checks were successful
pipeline / build-and-push-images (push) Successful in 24s
pipeline / deploy (push) Successful in 7s

This commit is contained in:
2024-11-25 00:14:04 +01:00
parent 23752c6e09
commit 497e40853d

View File

@@ -1,12 +1,17 @@
<script setup>
const {data: champions} = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")
const filteredChampions = ref(champions.value.slice(1))
champions.value = champions.value.slice(1).sort((a, b) => {
if(a.name < b.name) return -1;
if(a.name > b.name) return 1;
return 0;
})
const filteredChampions = ref(champions.value)
const searchBar = ref(null)
watch(searchBar, (newS, oldS) => {searchBar.value.focus()})
const searchText = ref("")
watch(searchText, (newT, oldT) => {
filteredChampions.value = champions.value.slice(1).filter((champion) => champion.name.toLowerCase().includes(searchText.value.toLowerCase()))
filteredChampions.value = champions.value.filter((champion) => champion.name.toLowerCase().includes(searchText.value.toLowerCase()))
})
async function submit() {