diff options
| author | Shpuld Shpludson <shp@cock.li> | 2019-02-04 04:17:11 +0000 |
|---|---|---|
| committer | Shpuld Shpludson <shp@cock.li> | 2019-02-04 04:17:11 +0000 |
| commit | d6ee6e8394a86cadc1419f014dc5e77569c62c75 (patch) | |
| tree | 86172bb8f27a7f3a4835e1db431c979bdf088a52 /src/components/user_avatar/user_avatar.js | |
| parent | 7115584882f4fde67d248fa61611dbe579a41b9f (diff) | |
| parent | e7f43d6bc3c97f5a98df3e3d6defabe896e7cdce (diff) | |
Merge branch '275-avatar-placeholder' into 'develop'
Support avatar placeholder
Closes #275
See merge request pleroma/pleroma-fe!511
Diffstat (limited to 'src/components/user_avatar/user_avatar.js')
| -rw-r--r-- | src/components/user_avatar/user_avatar.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js new file mode 100644 index 00000000..e513b993 --- /dev/null +++ b/src/components/user_avatar/user_avatar.js @@ -0,0 +1,29 @@ +import StillImage from '../still-image/still-image.vue' + +const UserAvatar = { + props: [ + 'src', + 'betterShadow', + 'compact' + ], + data () { + return { + showPlaceholder: false + } + }, + components: { + StillImage + }, + computed: { + imgSrc () { + return this.showPlaceholder ? '/images/avi.png' : this.src + } + }, + methods: { + imageLoadError () { + this.showPlaceholder = true + } + } +} + +export default UserAvatar |
