diff --git a/src/components/Index.vue b/src/components/Index.vue index be13ec4..57003c8 100644 --- a/src/components/Index.vue +++ b/src/components/Index.vue @@ -11,7 +11,7 @@ anchor="bottom right" self="top right" > - Export Chosen Spells + Export Selected Spells @@ -21,7 +21,7 @@ anchor="bottom right" self="top right" > - Import Chosen Spells + Import Selected Spells @@ -33,12 +33,38 @@ > -
- +
+ + + All Spells + + + My Spells + +
+ +
+
+ +
+ +
+ +
None :D
+
+
+ @@ -78,6 +104,19 @@ export default { search: '' } }, + computed: { + mySpells () { + if (!this.state.spells.loaded || this.state.chosen.length === 0) { + return [] + } + + return this.state.chosen.map(chosen => { + return this.state.spells.data.find(spell => { + return spell.name === chosen + }) + }) + } + }, mounted () { if (!this.state.spells.loaded) { Loading.show() diff --git a/src/components/Spellitem.vue b/src/components/Spellitem.vue index 68e8985..9e7d551 100644 --- a/src/components/Spellitem.vue +++ b/src/components/Spellitem.vue @@ -12,7 +12,18 @@
+ bookmark + bookmark_border @@ -35,11 +46,14 @@ export default { }, classes () { return this.spell.classes.map(cla => capitalize(cla)).join(', ') + }, + checked () { + return this.state.chosen.indexOf(this.spell.name) >= 0 } }, data () { return { - checked: false + state } }, props: [ @@ -62,3 +76,8 @@ export default { } } + +