gpt4 book ai didi

javascript - 如何在 React JS 中将图像源作为属性传递?

转载 作者:行者123 更新时间:2023-12-04 10:11:50 25 4
gpt4 key购买 nike

关闭。这个问题需要更多focused .它目前不接受答案。












想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post .

去年关闭。




Improve this question




如何将图像源作为属性( Prop )传递给子类?

最佳答案

这可能对您有所帮助。

<ClidClass imageSrc={'YOUR IMAGE SRC'} /> 
在 child 类
componentDidMount(){
let imgSrc= this.props.imageSrc

}
如果你还有什么困惑你可以问。

关于javascript - 如何在 React JS 中将图像源作为属性传递?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61299968/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com