React+AntDesign入门:五、AntDesign UI组件-通知提醒弹窗Notification
五、AntDesign UI组件-通知提醒弹窗Notification
1.简单使用:
代码:
/**
* AntDesign UI 通知提醒弹窗Notification示例
*/
import React from 'react'
import {Card, Button, notification} from 'antd'
class UiNotification extends React.Component{
constructor(props){
super(props);
this.state = {
}
}
openNotification = ()=>{
//使用notification.success()弹出一个通知提醒框
notification.success({
message:"通知提醒框的标题",
description:"通知提醒框的内容"
});
}
render() {
return (
<div>
<Card title={"提醒弹窗Notification"}>
<Button type={"primary"} onClick={this.openNotification}>弹出一个通知提醒框</Button>
</Card>
</div>
)
}
}
export default UiNotification;
效果: