pleroma-fe/src/components/user_avatar/user_avatar.js

35 lines
555 B
JavaScript
Raw Normal View History

import StillImage from '../still-image/still-image.vue'
const UserAvatar = {
props: [
'user',
'betterShadow',
'compact'
],
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
}
},
methods: {
imageLoadError () {
this.showPlaceholder = true
}
},
watch: {
src () {
this.showPlaceholder = false
}
}
}
export default UserAvatar