We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 865c4fe commit 036225bCopy full SHA for 036225b
2 files changed
src/assets/defaultskin.png
303 Bytes
src/components/Avatar.vue
@@ -1,11 +1,14 @@
1
<template>
2
<img
3
- :src="`https://crafthead.net/helm/${key}`"
+ :src="`https://crafthead.net/helm/${key}/8`"
4
:title="title && `${name}'s avatar`"
5
+ @error="replaceWithDefault"
6
/>
7
</template>
8
9
<script>
10
+import defaultSkin from '../assets/defaultskin.png';
11
+
12
export default {
13
props: {
14
id: {
@@ -24,5 +27,10 @@ export default {
24
27
return this.id.replace(/-/g, '');
25
28
},
26
29
30
+ methods: {
31
+ replaceWithDefault(e) {
32
+ e.target.src = defaultSkin;
33
+ },
34
35
};
36
</script>
0 commit comments