I have an Articles component that shows a blog page with listed articles.
render() {
const articles = {
...this.state.articles
}
const article = Object.keys(articles).map(cur => {
return <Article
key={this.state.articles[cur].id}
imgName={this.state.articles[cur].thumb}
title={this.state.articles[cur].title}
meta={this.state.articles[cur].meta}
clicked={() => this.detailedHandler(this.state.articles[cur].id)}
detailed={this.state.articles[cur].detailed} />
});
Run Code Online (Sandbox Code Playgroud)
As you can see I pass image name with props to Article component. I want then to display the appropriate image for each article.
How do I import an image in Article component based on the props I receive (props.imgName) from …
我在我的项目中使用 material-ui。对于数据表,我使用材料表。material-ui 基本表格有道具“stickyHeader”,它在滚动表格主体时固定表格标题。我需要同样的材料表,但我找不到类似的东西。
我试图用自定义 css 来做,但我的表格变得依赖于布局。是否有任何简单的解决方案可以为我的材料表固定页脚和页眉?