gancio-upstream/pages/embed/list.vue

28 lines
711 B
Vue
Raw Normal View History

<template lang="pug">
2019-05-30 12:04:14 +02:00
List(:events="events" :title='title')
</template>
<script>
2019-05-30 12:04:14 +02:00
import List from '../../components/List'
export default {
2019-05-30 12:04:14 +02:00
components: { List },
2021-03-19 12:01:37 +01:00
layout: 'iframe',
2019-07-27 13:05:02 +02:00
async asyncData ({ query, $axios }) {
const title = query.title
const tags = query.tags
const places = query.places
2021-07-27 22:01:34 +02:00
const show_recurrent = !!query.show_recurrent
2019-05-30 12:04:14 +02:00
2019-05-30 12:12:51 +02:00
let params = []
2019-09-11 19:12:24 +02:00
if (places) { params.push(`places=${places}`) }
if (tags) { params.push(`tags=${tags}`) }
2021-07-27 22:01:34 +02:00
if (show_recurrent) { params.push('show_recurrent=1') }
2019-05-30 12:04:14 +02:00
2019-05-30 12:12:51 +02:00
params = params.length ? `?${params.join('&')}` : ''
const events = await $axios.$get(`/export/json${params}`)
return { events, title }
2019-09-11 19:12:24 +02:00
}
}
</script>