Sort sessions alphabetically by title
This commit is contained in:
parent
15b093f94e
commit
d1e1b08feb
11
src/App.vue
11
src/App.vue
|
@ -1,12 +1,13 @@
|
|||
<template>
|
||||
<div id="app" class="antialiased min-h-screen font-sans bg-gray-100 text-black p-12">
|
||||
<accepted-sessions-list :sessions="sessions" />
|
||||
<accepted-sessions-list :sessions="sortedSessions" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style src="./css/app.css"></style>
|
||||
|
||||
<script>
|
||||
import _ from 'lodash'
|
||||
import AcceptedSessionsList from '@/components/AcceptedSessionsList'
|
||||
|
||||
const axios = require('axios')
|
||||
|
@ -31,6 +32,14 @@ export default {
|
|||
this.loaded = true
|
||||
this.sessions = data.data
|
||||
})
|
||||
},
|
||||
|
||||
computed: {
|
||||
sortedSessions: function () {
|
||||
return _(this.sessions).sortBy(session => {
|
||||
return session.attributes.title
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -18,7 +18,7 @@ import _ from 'lodash'
|
|||
export default {
|
||||
props: {
|
||||
sessions: {
|
||||
type: Array,
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue