1
0
Fork 0
mirror of https://github.com/em-squared/5e-drs.git synced 2025-10-31 13:34:21 +00:00

outils de création de sorts/monstres/objets

This commit is contained in:
Maxime Moraine 2020-04-22 11:17:05 +02:00
parent 6237f0e6a2
commit a6986c42c6
48 changed files with 2743 additions and 259 deletions

View file

@ -1,20 +1,57 @@
<template>
<div class="monster">
<Breadcrumb />
<Monster />
<div class="d-flex align-center mb-4 d-print-none">
<Breadcrumb class="mr-auto" />
<v-btn color="primary" class="mr-4" depressed link to="/creation-de-monstre-pnj/"><v-icon left>mdi-plus</v-icon> Créer un monstre</v-btn>
<v-btn :outlined="!isMonsterInBestiary" color="accent" class="mr-4" depressed @click="toggleMonsterInBestiary"><v-icon>mdi-book</v-icon> {{ displayToggleMonsterButton }}</v-btn>
<v-btn color="primary" class="mr-4" depressed link to="/mon-bestiaire/">Mon Bestiaire</v-btn>
</div>
<Monster :monster="$page" />
<Edit />
</div>
</template>
<script>
import Breadcrumb from '@theme/components/Breadcrumb'
import Monster from '@theme/components/Monster'
import Edit from '@theme/components/Edit'
export default {
name: 'MonsterLayout',
components: {
Breadcrumb,
Monster
Monster,
Edit
},
computed: {
isMonsterInBestiary () {
let isInBestiary = false
for (let s of this.$store.state.myMonsters.monsters) {
if (s.key == this.$page.key) {
isInBestiary = true
}
}
return isInBestiary
},
displayToggleMonsterButton () {
if (this.isMonsterInBestiary) {
return 'Supprimer de mon grimoire'
}
return 'Ajouter à mon grimoire'
}
},
methods: {
toggleMonsterInBestiary () {
if (this.isMonsterInBestiary) {
this.$store.commit('myMonsters/removeMonster', this.$page)
} else {
this.$store.commit('myMonsters/addMonster', this.$page)
}
}
},
mounted () {