decoupling-drupal-vuejs/vuejs/src/components/AcceptedSessionsList.vue

33 lines
631 B
Vue
Raw Normal View History

<template>
2019-05-25 16:21:05 +01:00
<div>
2019-08-30 17:35:26 +01:00
<h1 class="text-4xl">Accepted Sessions</h1>
2019-08-30 17:35:14 +01:00
<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">
2019-05-25 16:19:12 +01:00
{{ 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>