我正在学习使用React JS和Ant Design,但是目前很困惑。
我想创建一个简单的无状态反应页面,其中显示了迪士尼人物的图像。单击图像后,将使用字符信息(即性别,身高,种类等)更新“卡片”组件。如果我单击其他角色的图像,其信息将更新为同一Card组件。我似乎找不到关于如何更新Card组件的说明的好资料。
如果有更好的方法来完成相同的任务,单击图像可以更新包含角色信息信息的简单框,那么我很乐意学习替代方法。
任何人都能提供的见解将不胜感激。谢谢。
答案 0 :(得分:0)
最简单的解决方案是创建一个简单的对象数组,其中包含要呈现的信息。一旦有了这些,我们就可以将其映射到新的公主卡组件数组中,这些组件仅包含显示/隐藏更多信息的逻辑。
有关完整的工作示例,请参见codeandbox示例。
princesses: [
{
name: "Rapunzel",
image:
"https://lumiere-a.akamaihd.net/v1/images/character_princess_rapunzel_314b7a09.jpeg?region=0%2C0%2C450%2C450&optimize=true",
height: "5' 1",
weight: 95,
age: "18"
},
{
name: "Anna",
image:
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxEQEBUQEBAWFhUVFRUYFRcXGBYVFRcVFhYWFxYXFRUYHSggGB0lHRUVITEhJSkrLi4uFx8zODMsNyktLisBCgoKDg0OGhAQGi0lICUtLS0tLS0tNy0uLS0tNy0yLS0tLS0tLTUtLy0wLS0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOEA4QMBEQACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAACAwQFBgEHAP/EAEMQAAIBAgMECAMDCgYCAwEAAAECAAMRBCExBRJBUQYTImFxgZGhMrHwQsHRBxQzUmJyc7Lh8SM0gpKzwhXSNUOiFv/EABsBAAMAAwEBAAAAAAAAAAAAAAABAgMEBQYH/8QAPBEAAgECBAMFBwIFAwQDAAAAAAECAxEEEiExBUFRE2FxkbEiMoGhwdHwBuEUIzNC8RU0ckNigqIkUlP/2gAMAwEAAhEDEQA/AMQBO6cwICBIQEACAgIMCMVwgICCAgK4QWMAgsYggsBHd2AHd2Aju7ALnd2AH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64GDKQ9Pw+cC2S10P+r5RC5nzfAPA/JoczLH8+RX4nTz/GZEZEAdfOUhDqX2vAf9omJ8h+E+LykS2IexUdJP0n+t/wDrIlsjXrbQJn5L/wDOVv4P3tOLxPaJxpf1ZeC+pJ6f/wCVw/77fyLI4bu/Ar+5kLb/APkH/hUv+Vp2avu/ncdDH/7aX5yNX0Q/ylD+HQ/46c84v9x/5fU4E/8Abv8A4/Q1uM/S0v4df/koTo8R9xeP0ORwv334P1R5b+Xr9NhP4DfzyMJ7puVvePMsN8S/vL85toiHvLxPT+jn/wAg38N/5kkcX/pLxPU4r3y423/lqXiP+WaPDP8Acr/ix4bdljsjUfun/tO3MyVdis6WfoqHgP5BNjDe9L85nnuP/wBOH/J+jMuZtnmQTEMEwGCYACYDORDP/9k=",
height: "5' 0",
weight: 92,
age: "18"
},
{
name: "Merida",
image:
"https://lumiere-a.akamaihd.net/v1/images/character_princess_merida_eb06acab.jpeg?region=0,0,450,450",
height: "5' 4",
weight: 104,
age: "16"
}
]
class PrincessCard extends React.Component {
state = {
open: false
};
toggleOpen = () => this.setState(prevState => ({ open: !prevState.open }));
render() {
return (
<Col xs={8}>
<Card
hoverable={true}
cover={<img alt={this.props.name} src={this.props.data.image} />}
actions={[
<Button block={true} onClick={this.toggleOpen}>
{this.state.open ? "Show less info" : "Show more info"}
</Button>
]}
>
{this.props.data.name}
{this.state.open && (
<React.Fragment>
<Divider />
<List
bordered
dataSource={[
`Age: ${this.props.data.age}`,
`Height: ${this.props.data.height}`,
`Weight: ${this.props.data.weight}`
]}
renderItem={item => <List.Item>{item}</List.Item>}
/>
</React.Fragment>
)}
</Card>
</Col>
);
}
}