decoupling-drupal-vuejs/vuejs/src/components/AcceptedSessionsList.vue
2019-08-30 17:35:26 +01:00

32 lines
631 B
Vue

<template>
<div>
<h1 class="text-4xl">Accepted Sessions</h1>
<div v-if="sessions.length" class="mt-2 p-6 bg-white rounded-lg border">
<ul>
<li v-for="{ attributes } in sortedSessions" :key="attributes.drupal_internal__nid" class="mt-3 first:mt-0">
{{ attributes.title }}
</li>
</ul>
</div>
</div>
</template>
<script>
import sortBy from 'lodash/sortBy'
export default {
props: {
sessions: {
type: Array,
required: true
}
},
computed: {
sortedSessions: function () {
return sortBy(this.sessions, 'attributes.title')
}
}
}
</script>