Sorting by level works as expected
This commit is contained in:
parent
a30d0db4e4
commit
5c73ec1c9d
2 changed files with 2 additions and 5 deletions
|
@ -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,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -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)
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue