Do the sorting within AcceptedSessionsList

This commit is contained in:
Oliver Davies 2019-08-30 13:56:07 +01:00
parent 15e921239e
commit a39497e8d4
2 changed files with 11 additions and 11 deletions
vuejs/src/components

View file

@ -4,7 +4,7 @@
<div v-if="sessions.length" class="bg-white p-6 rounded-lg border">
<ul class="-mb-3">
<li v-for="{ attributes } in sessions" :key="attributes.drupal_internal__nid" class="mb-3">
<li v-for="{ attributes } in sortedSessions" :key="attributes.drupal_internal__nid" class="mb-3">
{{ attributes.title }}
</li>
</ul>
@ -13,12 +13,20 @@
</template>
<script>
import sortBy from 'lodash/sortBy'
export default {
props: {
sessions: {
type: Object,
type: Array,
required: true
}
},
computed: {
sortedSessions: function () {
return sortBy(this.sessions, 'attributes.title')
}
}
}
</script>