2021-05-09 13:49:40 +02:00
|
|
|
"use strict"
|
|
|
|
|
|
2021-05-01 08:42:39 +02:00
|
|
|
const ImageTeaser = {
|
|
|
|
|
name: 'image-teaser',
|
|
|
|
|
props: {
|
|
|
|
|
image: Object
|
|
|
|
|
},
|
|
|
|
|
template: `<div class="imageteaser" :style="style" @click="onClick"></div>`,
|
|
|
|
|
computed: {
|
|
|
|
|
style() {
|
|
|
|
|
const url = this.image.url.replace('uploads/', 'uploads/r/') + '-150x100.webp'
|
|
|
|
|
return {
|
|
|
|
|
'background-image': `url("${url}")`,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onClick() {
|
|
|
|
|
this.$emit('click')
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ImageTeaser
|