gancio/components/List.vue

62 lines
1.2 KiB
Vue
Raw Normal View History

<template lang='pug'>
2019-05-30 12:04:14 +02:00
div#list
2020-07-28 12:24:39 +02:00
p(v-if='title') {{title}}
2020-07-29 00:25:45 +02:00
v-timeline(dense)
2020-07-28 12:24:39 +02:00
v-timeline-item(
2020-11-13 00:13:44 +01:00
v-for='event in computedEvents'
2020-07-29 00:25:45 +02:00
:key='`${event.id}_${event.start_datetime}`')
2021-01-22 23:07:32 +01:00
.text-subtitle <v-icon small color='success' v-if='event.parentId'>mdi-repeat</v-icon> {{event|when}}
2020-11-13 00:13:44 +01:00
.text-subtitle.float-right @{{event.place.name}}
2021-01-22 23:07:32 +01:00
a.text-body-1(:href='`/event/${event.id}`' target='_blank') {{event.title}}
</template>
<script>
2019-05-30 12:04:14 +02:00
export default {
name: 'List',
props: {
2019-05-30 12:04:14 +02:00
title: {
type: String,
2019-06-06 23:54:32 +02:00
default: ''
2019-05-30 12:04:14 +02:00
},
events: {
type: Array,
default: () => {
return []
}
},
maxEvents: {
type: Number,
default: 0
},
minimal: {
type: Boolean,
default: false
2019-05-30 12:04:14 +02:00
},
showTags: {
type: Boolean,
2019-09-11 19:12:24 +02:00
default: true
2019-05-30 12:04:14 +02:00
},
showImage: {
type: Boolean,
2019-09-11 19:12:24 +02:00
default: true
2019-05-30 12:04:14 +02:00
},
showDescription: {
type: Boolean,
default: true
}
2020-11-13 00:13:44 +01:00
},
computed: {
computedEvents () {
if (!this.maxEvents) { return this.events }
return this.events.slice(0, this.maxEvents)
}
2019-09-11 19:12:24 +02:00
}
}
2019-05-30 12:04:14 +02:00
</script>
<style lang='less'>
#list {
max-width: 500px;
2019-07-11 22:29:18 +02:00
margin: 0 auto;
}
2019-05-30 12:04:14 +02:00
</style>