sort tags in filter

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2020-09-07 14:24:48 +02:00
committed by Julius Härtl
parent 0d447fff01
commit 7c0403bfc9
3 changed files with 12 additions and 7 deletions

View File

@@ -56,7 +56,7 @@
tag="ul"
class="labels"
@click="openCard">
<li v-for="label in card.labels" :key="label.id" :style="labelStyle(label)">
<li v-for="label in labelsSorted" :key="label.id" :style="labelStyle(label)">
<span @click="applyLabelFilter(label)">{{ label.title }}</span>
</li>
</transition-group>
@@ -122,7 +122,9 @@ export default {
currentCard() {
return this.card && this.$route && this.$route.params.cardId === this.card.id
},
labelsSorted() {
return [...this.card.labels].sort((a, b) => (a.title < b.title) ? -1 : 1)
},
},
methods: {
openCard() {