gancio/pages/place/_place.vue

44 lines
1.3 KiB
Vue
Raw Normal View History

2022-05-23 14:41:07 +02:00
<template>
2022-06-07 21:08:47 +02:00
<v-container class='px-0' fluid>
<h1 class='d-block text-h4 font-weight-black text-center text-uppercase mt-10 mx-auto w-100 text-underline'>
<u>{{ place.name }}</u>
</h1>
<span class="d-block text-subtitle text-center w-100 mb-14">{{ place.address }}</span>
2022-05-23 14:41:07 +02:00
<!-- Events -->
<div class="mb-2 mt-1 pl-1 pl-sm-2" id="events">
<Event :event='event' v-for='(event, idx) in events' :lazy='idx > 2' :key='event.id'></Event>
2022-05-23 14:41:07 +02:00
</div>
</v-container>
</template>
<script>
2022-06-18 01:09:25 +02:00
import { mapState } from 'vuex'
2022-05-23 14:41:07 +02:00
import Event from '@/components/Event'
export default {
2022-06-18 01:09:25 +02:00
name: 'Place',
2022-05-23 14:41:07 +02:00
components: { Event },
head() {
2022-06-18 01:09:25 +02:00
const title = `${this.settings.title} - ${this.place.name}`
return {
title,
link: [
{ rel: 'alternate', type: 'application/rss+xml', title, href: this.settings.baseurl + `/feed/rss/place/${this.place.name}` },
{ rel: 'alternate', type: 'text/calendar', title, href: this.settings.baseurl + `/feed/ics/place/${this.place.name}` }
]
}
},
computed: mapState(['settings']),
asyncData({ $axios, params, error }) {
2022-05-23 14:41:07 +02:00
try {
const place = params.place
return $axios.$get(`/place/${encodeURIComponent(place)}`)
2022-05-23 14:41:07 +02:00
} catch (e) {
error({ statusCode: 400, message: 'Error!' })
}
}
}
</script>