2019-02-02 20:11:36 +01:00
|
|
|
import StillImage from '../still-image/still-image.vue'
|
|
|
|
|
|
|
|
const UserAvatar = {
|
|
|
|
props: [
|
2019-05-01 16:33:56 +02:00
|
|
|
'user',
|
2019-02-02 21:33:02 +01:00
|
|
|
'betterShadow',
|
|
|
|
'compact'
|
2019-02-02 20:11:36 +01:00
|
|
|
],
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
showPlaceholder: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
StillImage
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
imgSrc () {
|
2019-08-28 20:02:04 +02:00
|
|
|
return this.showPlaceholder ? '/images/avi.png' : this.user.profile_image_url_original
|
2019-02-02 20:11:36 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
imageLoadError () {
|
|
|
|
this.showPlaceholder = true
|
|
|
|
}
|
2019-03-14 22:04:30 +01:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
src () {
|
|
|
|
this.showPlaceholder = false
|
|
|
|
}
|
2019-02-02 20:11:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default UserAvatar
|