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

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2021-10-06
  • 2022-12-23
  • 2021-04-24
  • 2021-12-11
  • 2022-12-23
  • 2021-09-20
相关资源
相似解决方案