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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_29668759/article/details/88746342

五、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;

效果:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_29668759/article/details/88746342