I'm using vuejs with Element UI, I want to show loading indicator when begin load image from src attr, hide loading indicator when load
event(img loaded) trigger.
The load
event works well, but loadstart
never fire.
Here is snippet:
<div v-loading="imgLoading">
<img
:src="imgOfSelectedColor"
@loadstart="showImgLoading"
@load="hideImgLoading"
@error="hideImgLoading"
@abort="hideImgLoading"
>
</div>
export default {
data() {
return {
imgLoading: false
};
},
methods: {
showImgLoading() {
this.imgLoading = true;
},
hideImgLoading() {
this.imgLoading = false;
}
}
}
loadstart
event as the 11th step of updating-the-image-data algorithm. Now, only Firefox among common browsers implemented this part of the specs, so ifeng, which browser did you test this from?Chrome 73.0.3683.103 x64
.