How to display loading.gif? in vue when the picture is not loaded

what I want to do is to display the loading.gif diagram when the picture is not loaded.
my picture (figure 9) is in a div1, and the address of the picture is in the array imgPath = []. When the array is empty, the div1, of div1 is created
when the array is not empty. I wrote img.onload, in the mounted hook function, but it seems that because the div is not created, this img.onload has no effect. I don"t know if this is the case. Of course, my focus is on how to display the loading.gif diagram

when the picture is not loaded.

when the array imgPath is not empty, the image address defaults to loading.gif, until a href= "https://codepen.io/luren/pen/MXaVwX" rel=" nofollow noreferrer "demo

is replaced by the real image when you think it is appropriate.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2bb39-2b30b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2bb39-2b30b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?