marc-leopold/pages/galleries.vue

54 lines
1.0 KiB
Vue
Raw Normal View History

2019-01-03 21:10:44 +00:00
<template>
2019-02-14 21:31:01 +00:00
<GalleryPage v-if="galleries && galleries.length > 0" :galleries="galleries">
2019-01-03 21:10:44 +00:00
</GalleryPage>
2019-02-17 15:21:32 +00:00
<NoContent v-else :heading="title"
2019-02-14 21:31:01 +00:00
message="My galleries are being prepared for upload, please check back soon."
/>
2019-01-03 21:10:44 +00:00
</template>
<script>
import GalleryPage from '@/components/GalleryPage'
2019-02-14 21:31:01 +00:00
import NoContent from '@/components/NoContent'
2019-01-03 21:10:44 +00:00
export default {
2019-01-31 10:20:14 +00:00
name: 'GalleriesPage',
2019-01-03 21:10:44 +00:00
components: {
2019-02-14 21:31:01 +00:00
GalleryPage,
NoContent,
2019-01-03 21:10:44 +00:00
},
2019-02-06 12:45:22 +00:00
data () {
return {
galleries: false,
}
},
2019-01-31 10:20:14 +00:00
head () {
return {
2019-02-17 15:21:32 +00:00
// title: 'My Galleries',
title: this.title,
2019-02-04 12:53:18 +00:00
meta: [{
hid: 'description',
name: 'description',
content: 'A showcase of the work of photographer Marc Leopold.'
}],
2019-01-31 10:20:14 +00:00
}
},
2019-02-06 12:45:22 +00:00
async asyncData ({ $axios }) {
2019-02-14 21:31:01 +00:00
try {
2019-02-17 15:21:32 +00:00
let { galleries, title } = await $axios.$get('/api/v1/galleries')
if (title === '') {
title = 'My Galleries'
}
return { galleries, title }
2019-02-14 21:31:01 +00:00
} catch {
return {
galleries: []
}
}
2019-02-04 12:00:30 +00:00
},
2019-01-03 21:10:44 +00:00
}
</script>