- [spell-card] Added comma and ingredients display

This commit is contained in:
Alexis
2020-04-06 17:25:38 +02:00
parent 042c205ce4
commit 64f5e109dd
2 changed files with 6 additions and 4 deletions

View File

@@ -31,9 +31,11 @@
</div> </div>
</div> </div>
<div class="casting-ingredients"> <div class="casting-ingredients">
<p class="title">Nécessite</p> <p class="title">Nécessite :</p>
<p class="content"> <p class="content">
<span v-for="(ingredient, index) in ingredients" :key="index">{{ ingredient }}</span> <span v-for="(ingredient, index) in ingredients" :key="index">
{{ ingredient.name }}<span v-if="index != Object.keys(ingredients).length - 1">, </span>
</span>
</p> </p>
</div> </div>
</section> </section>

View File

@@ -5,9 +5,9 @@
</template> </template>
<script> <script>
// Components // Components
import spellcard from "./spell-card" import spellcard from "./spell-card"
// API // API
import { RepositoryFactory } from "../../../api/repositories" import { RepositoryFactory } from "../../../api/repositories"
const spellsRepository = RepositoryFactory.get('spells') const spellsRepository = RepositoryFactory.get('spells')
@@ -35,7 +35,7 @@ export default {
this.loading = true this.loading = true
const displaySpells = await this.fetchSpells(); const displaySpells = await this.fetchSpells();
this.loading = false this.loading = false
this.spells = displaySpells.splice(0,10) this.spells = displaySpells.slice(0, 10)
} }
} }
} }