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

correction bug grimoire

This commit is contained in:
Maxime Moraine 2021-01-07 10:10:18 +01:00
parent 417d3edaed
commit 4ee9f0202a
2 changed files with 46 additions and 2 deletions

View file

@ -40,7 +40,7 @@
<div class="ml-md-12">
<div class="d-flex" v-if="spellSlots[group] > 0">
<div v-for="(slot, idx) in Number(spellSlots[group])" :key="idx">
<v-checkbox dark hide-details class="spell-slot"></v-checkbox>
<v-checkbox dark hide-details class="spell-slot" v-model="spellCast[group][idx]"></v-checkbox>
</div>
</div>
</div>
@ -152,7 +152,15 @@ export default {
return this.$store.state.mySpells.spellSlots
},
set (value) {
this.$store.commit('mySpells/setSpells', value)
this.$store.commit('mySpells/setSpellSlots', value)
}
},
spellCast: {
get () {
return this.$store.state.mySpells.spellCast
},
set (value) {
this.$store.commit('mySpells/setSpellCast', value)
}
}
},
@ -168,6 +176,10 @@ export default {
onInputSpellSlots () {
this.$store.commit('mySpells/setSpellSlots', this.spellSlots)
},
onInputSpellCast (level, idx, value) {
this.spellCast[level][idx] = value
this.$store.commit('mySpells/setSpellCast', this.spellCast)
},
hasSpellOfLevel (level) {
for (let spell of this.spells) {
if (spell.frontmatter.level == level && !this.isHiddenPrint(spell)) {