1
0
Fork 0

Merge pull request #27 from sharpshark28/26

Sorting by level works as expected
This commit is contained in:
Joe L Wroten 2017-08-18 00:07:11 -05:00 committed by GitHub
commit 6d188edef3
2 changed files with 2 additions and 5 deletions

View file

@ -28,7 +28,7 @@ let indexedSpells = spellsWithIDs.map(spell => {
id: spell.id, id: spell.id,
name: spell.name, name: spell.name,
classes: spell.classes, classes: spell.classes,
level: spell.level, level: spell.level.toLowerCase() === 'cantrip' ? 0 : parseInt(spell.level),
link: '/spell/' + spell.id, link: '/spell/' + spell.id,
} }
}) })

View file

@ -1,7 +1,7 @@
<template> <template>
<div v-bind:class="{'checked': checked}"> <div v-bind:class="{'checked': checked}">
<div class="item-primary"> <div class="item-primary">
{{level}} {{spell.level}}
</div> </div>
<div class="item-content has-secondary"> <div class="item-content has-secondary">
<router-link :to="spell.link"> <router-link :to="spell.link">
@ -35,9 +35,6 @@ import { capitalize } from '../utils'
export default { export default {
computed: { computed: {
level () {
return this.spell.level.toLowerCase() === 'cantrip' ? '0' : this.spell.level.charAt(0)
},
school () { school () {
return capitalize(this.spell.school) return capitalize(this.spell.school)
}, },