This repository has been archived on 2024-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
node-fftcg/frontend/src/components/DeckList.vue

53 lines
948 B
Vue

<template>
<v-expansion-panel v-if="value">
<Deck v-for="deck in decks" :deck="deck" :key="deck.id" />
</v-expansion-panel>
</template>
<script>
import CardsDB from '@/plugins/ffdecks'
import Deck from './Deck.vue'
export default {
name: 'DeckList',
props: {
value: Array
},
components: {
Deck
},
computed: {
decks() {
let result = []
for (let i = 0; i < this.value.length; i++) {
let elem = this.value[i]
let cards = []
for (let j = 0; j < elem.content.cards.length; j++) {
let card = elem.content.cards[j]
cards.push({
count: card.count,
serial: card.serial,
dbentry: CardsDB[card.serial]
})
}
result.push({
id: elem.id,
name: elem.content.name,
note: elem.content.note,
cards: cards
})
}
return result
}
}
}
</script>