React+AntDesign入门:五、AntDesign UI组件-通知提醒弹窗Notification

释放双眼,带上耳机,听听看~!

五、AntDesign UI组件-通知提醒弹窗Notification

1.简单使用:

代码:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
1/**
2 * AntDesign UI 通知提醒弹窗Notification示例
3 */
4import React from 'react'
5import {Card, Button, notification} from 'antd'
6
7class UiNotification extends React.Component{
8
9  constructor(props){
10    super(props);
11
12    this.state = {
13
14    }
15  }
16
17  openNotification = ()=>{
18    //使用notification.success()弹出一个通知提醒框
19    notification.success({
20      message:"通知提醒框的标题",
21      description:"通知提醒框的内容"
22    });
23  }
24
25
26  render() {
27    return (
28      <div>
29        <Card title={"提醒弹窗Notification"}>
30          <Button type={"primary"} onClick={this.openNotification}>弹出一个通知提醒框</Button>
31        </Card>
32      </div>
33    )
34  }
35
36}
37
38export default UiNotification;
39
40

效果:
React+AntDesign入门:五、AntDesign UI组件-通知提醒弹窗Notification

给TA打赏
共{{data.count}}人
人已打赏
安全技术

常用加密解密算法【RSA、AES、DES、MD5】介绍和使用

2021-8-18 16:36:11

安全技术

C++ 高性能服务器网络框架设计细节

2022-1-11 12:36:11

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索