More typescript
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
type ChampionResponse = {
|
||||
data: Ref<Array<Champion>>
|
||||
}
|
||||
type Champion = {
|
||||
name: string
|
||||
alias: string
|
||||
squarePortraitPath: string
|
||||
}
|
||||
const {data: championsData} : ChampionResponse = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")
|
||||
const {data: championsData} : ChampionsResponse = await useFetch(CDRAGON_BASE + "plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json")
|
||||
const champions = championsData.value.slice(1).sort((a, b) => {
|
||||
if(a.name < b.name) return -1;
|
||||
if(a.name > b.name) return 1;
|
||||
@@ -46,9 +38,6 @@ function filterToLane(filter: number) {
|
||||
|
||||
function onLaneFilterChange(newValue: number) {
|
||||
if(newValue != -1) {
|
||||
|
||||
|
||||
|
||||
filteredChampions.value = champions.filter((champion) => {
|
||||
const lanes : Array<any> = lanesMap.get(champion.alias.toLowerCase())
|
||||
if(lanes == undefined) return false;
|
||||
|
||||
Reference in New Issue
Block a user