marc-leopold/pages/galleries.vue

54 lines
1.0 KiB
Vue

<template>
<GalleryPage v-if="galleries && galleries.length > 0" :galleries="galleries">
</GalleryPage>
<NoContent v-else :heading="title"
message="My galleries are being prepared for upload, please check back soon."
/>
</template>
<script>
import GalleryPage from '@/components/GalleryPage'
import NoContent from '@/components/NoContent'
export default {
name: 'GalleriesPage',
components: {
GalleryPage,
NoContent,
},
data () {
return {
galleries: false,
}
},
head () {
return {
// title: 'My Galleries',
title: this.title,
meta: [{
hid: 'description',
name: 'description',
content: 'A showcase of the work of photographer Marc Leopold.'
}],
}
},
async asyncData ({ $axios }) {
try {
let { galleries, title } = await $axios.$get('/api/v1/galleries')
if (title === '') {
title = 'My Galleries'
}
return { galleries, title }
} catch {
return {
galleries: []
}
}
},
}
</script>