2019-02-02 11:11:36 -08:00
|
|
|
import StillImage from '../still-image/still-image.vue'
|
|
|
|
|
|
|
|
const UserAvatar = {
|
|
|
|
props: [
|
2019-02-02 12:33:02 -08:00
|
|
|
'src',
|
|
|
|
'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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default UserAvatar
|