![](/img/trans.png)
[英]How to use React Router Link component inside an Ant Design Tab component
[英]Ant Design of React - Use List component inside Dropdown component
我正在使用React的Ant设计。 我在Ant Design下拉组件中使用了Ant Design列表组件。
代码运行没问题,但是我在控制台中收到两个错误!
class App extends Component {
state = {
notifData: [
{ title: "Ant Design Title 1" },
{ title: "Ant Design Title 2" },
{ title: "Ant Design Title 3" },
{ title: "Ant Design Title 4" }
]
};
render() {
const headerNotifDropdown = (
<List
itemLayout="horizontal"
dataSource={this.state.notifData}
renderItem={item => (
<List.Item>
<List.Item.Meta
avatar={<Avatar icon="user" />}
title={item.title}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>
</List.Item>
)}
/>
);
return (
<ul>
<li>
<Dropdown overlay={headerNotifDropdown} trigger={["click"]}>
<a href="#notif">
<Badge count={5}>
<Icon type="notification" />
</Badge>
</a>
</Dropdown>
</li>
</ul>
);
}
}
有人可以帮忙吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.