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