【react】 后端返回图片或者json错误 ,前端加载和隐藏错误图片
后端返回图片或者json错误 ,前端加载和隐藏错误图片利用 img 的 onLoad 和 onError 方法:import React from 'react'; class ImgLoad extends React.Component { constructor(props) { super(props); this.state = { imageStatus: null,isError:true }; } handleImageLoaded() {