How to make <img > render after ajax gets the data (including src) in vue

The

diagram can be displayed. Since the binding value of : src does not exist at the beginning of ajax asynchronism, it will be reported

.
Cannot read property "avatar" of null"

when ajax comes back, the picture will come out

what should I do with this

Mar.05,2021

you first leave the position of the picture blank or put the default picture (the popular point is, write a div to set the height and width, put the picture in the div, and do not display the picture at first)

then define a variable flag, in data that controls picture display with an initial value of false

After

ajax gets the value, change the value of the variable just defined to true

finally, the display is controlled on the img by using the 'vmurshowrooms'.

if the impact of the large image will affect the interface, it is recommended to directly give the entire interface a loading, to obtain the value before displaying the interface.

the small image would be fine with the above method


judge: src= "item & & item.avatar"

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-1e3ca75-446ee.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-1e3ca75-446ee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?