我
在子组件中记录了一个数组列表,它返回初始数组。
从 API 更改数据后componentDidMount
,
如果我将该数组记录在render
函数的父组件中,我会得到一个对象数组。
它正在改变,
但它不是子组件。
我该怎么办 ??
该应用程序是关于使用 HTML 从用户那里获取图像,通过 API 发送它,然后将其添加到数据库中并将其另存为bytea
.
问题是我无法在需要时显示图像。
主页是我需要显示图像的地方。
axios.get('http://localhost:3333/api/getAllHairdressers').then((result)=>{
console.log(result.data);
this.setState({data:result.data})
})
}
Run Code Online (Sandbox Code Playgroud)
记录 data.result 是
counter : 1 cutprice : null description : null id : 32 image : {type: "Buffer", data: Array(438763)} location: null password : "123" salname : null username : "ttt"
那么我怎么能显示这个图像呢?我需要使用什么?