mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
hide image on feiled loading in card
This commit is contained in:
parent
bf9a87cb24
commit
a1bc604dd9
@ -14,7 +14,10 @@
|
||||
v-if="image || $slots.image">
|
||||
<!-- @slot Content of the card's image -->
|
||||
<slot name="image">
|
||||
<img :src="image" >
|
||||
<img
|
||||
:src="image"
|
||||
v-if="!error"
|
||||
@error="onError" >
|
||||
</slot>
|
||||
</div>
|
||||
<div
|
||||
@ -123,6 +126,16 @@ export default {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
error: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onError() {
|
||||
this.error = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user