IE 10+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |
通知组件,从屏幕某一侧滑入通知信息。
# yarn
yarn add xy-notification
import React from "react";
import ReactDOM from "react-dom";
import { noticePopup } from "xy-notification";
const close = noticePopup({
duration: 3000,
closeBtn: <span className="xy-close">✖</span>,
children: <p>弹出内容</p>,
});
属性 | 说明 | 类型 | 默认值 |
---|---|---|---|
children | 通知内容 | React.ReactNode | 无 |
closeBtn | 关闭按钮 | React.ReactNode | 无 |
placement | 通知滑出方向 | "topLeft"/"topRight"/"bottomLeft"/"bottomRight" | 无 |
visible | 是否可视 | boolean | 无 |
defaultVisible | 默认是否可视 | boolean | 无 |
duration | 过度时间 | number | 无 |
onClose | 通知关闭事件 | Function | 无 |
onUnmount | 通知关闭动画结束 | Function | 无 |
yarn run start
yarn run test
xy-notification is released under the MIT license.