cjd-parkball
Version:
> 中后台业务组件库,中后台就像公园,进入需要买门票(登录),所以以 Parkball(公园球) 命名,公园内必定捕获!作为一个组件库,提供使用方法文档,方便开发者的调用
49 lines (41 loc) • 1.1 kB
Markdown
---
category: 2
title: 位置
title_en: Placement
---
zh-CN
可以设置通知从右上角、右下角、左下角、左上角弹出。
en-US
A notification box can pop up from `topRight` or `bottomRight` or `bottomLeft` or `topLeft`.
````jsx
import { Button, Select, notification } from 'parkball';
const { Option } = Select;
const options = ['topLeft', 'topRight', 'bottomLeft', 'bottomRight'];
const openNotification = () => {
notification.open({
message: 'Notification Title',
description: 'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
});
};
ReactDOM.render(
<div>
<Select
defaultValue="topRight"
style={{ width: 120, marginRight: 10 }}
onChange={(val) => {
notification.config({
placement: val,
});
}}
>
{options.map(val => <Option key={val} value={val}>{val}</Option>)}
</Select>
<Button
type="primary"
onClick={openNotification}
>
Open the notification box
</Button>
</div>,
mountNode);
````