gancio/components/List.vue

73 lines
1.4 KiB
Vue
Raw Normal View History

<template lang='pug'>
2019-05-30 12:04:14 +02:00
div#list
2021-03-19 12:01:37 +01:00
v-list(dense)
v-list-item
h3(v-if='title') {{title}}
v-list-item(
target='_blank'
2021-04-14 01:30:51 +02:00
:to='`/event/${event.slug || event.id}`'
2020-11-13 00:13:44 +01:00
v-for='event in computedEvents'
2021-03-19 12:01:37 +01:00
:key='`${event.id}_${event.start_datetime}`' small)
v-list-item-content
v-list-item-subtitle <v-icon small color='success' v-if='event.parentId' v-text='mdiRepeat'></v-icon> {{event|when}}
2021-03-19 12:01:37 +01:00
span.primary--text.ml-1 @{{event.place.name}}
v-list-item-title(v-text='event.title')
</template>
<script>
import { mdiRepeat } from '@mdi/js'
2019-05-30 12:04:14 +02:00
export default {
name: 'List',
data () {
return { mdiRepeat }
},
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;
2021-03-19 12:01:37 +01:00
.v-list-item__title {
white-space: normal !important;
}
}
2019-05-30 12:04:14 +02:00
</style>