gancio-upstream/components/List.vue

92 lines
1.5 KiB
Vue
Raw Normal View History

<template lang="pug">
2019-05-30 12:04:14 +02:00
div#list
2019-07-27 13:05:02 +02:00
el-divider(v-if='title') {{title}}
2019-05-30 12:04:14 +02:00
el-timeline
el-timeline-item(
v-for='event in events'
2019-08-07 01:26:14 +02:00
:key='`${event.id}_${event.start_datetime}`'
2019-07-23 01:31:43 +02:00
:timestamp='event|when'
2019-05-30 12:04:14 +02:00
placement='top' icon='el-icon-arrow-down' size='large'
)
div.float-right
small @{{event.place.name}}
2019-07-23 01:31:43 +02:00
a(:href='"/event/" + link(event)' target='_blank') {{event.title}}
2019-05-30 12:04:14 +02:00
hr
</template>
<script>
2019-05-30 12:04:14 +02:00
import { mapGetters } from 'vuex'
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
}
},
2019-09-11 19:12:24 +02:00
data () {
return { }
},
methods: {
link (event) {
if (event.recurrent) {
return `${event.id}_${event.start_datetime}`
}
return event.id
}
}
}
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
.el-timeline {
padding-left: 5px;
hr {
margin-top: 4px;
margin-bottom: 4px;
}
}
.el-timeline-item {
padding-bottom: 1px;
}
.el-timeline-item__timestamp {
margin: 0px;
padding: 0px;
}
}
</style>