<a class="piece"
v-for="(piece, i) in news" :key="piece.id"
:class="{first: i===0 && checkImageLoad}"
>
methods:{
checkImageLoad() {
const s = this.news[0].image
return new Promise((resolve) => {
const img = new Image();
img.src = s;
img.onload = () => {
resolve(false);
};
img.onerror = () => {
resolve(false);
};
});
}
}