2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 1
|
|
|
|
title: 其他提示类型
|
|
|
|
---
|
2015-12-10 16:41:41 +08:00
|
|
|
|
|
|
|
包括成功、失败、警告。
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
import { message, Button } from 'antd';
|
|
|
|
|
2016-01-27 16:53:05 +08:00
|
|
|
const success = function () {
|
2015-12-10 16:41:41 +08:00
|
|
|
message.success('这是一条成功提示');
|
|
|
|
};
|
|
|
|
|
2016-01-27 16:53:05 +08:00
|
|
|
const error = function () {
|
2015-12-10 16:41:41 +08:00
|
|
|
message.error('这是一条报错提示');
|
|
|
|
};
|
|
|
|
|
2016-03-28 14:38:25 +08:00
|
|
|
const warning = function () {
|
|
|
|
message.warning('这是一条警告提示');
|
2015-12-10 16:41:41 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
ReactDOM.render(<div>
|
|
|
|
<Button onClick={success}>显示成功提示</Button>
|
|
|
|
<Button onClick={error}>显示报错提示</Button>
|
2016-03-28 14:38:25 +08:00
|
|
|
<Button onClick={warning}>显示警告提示</Button>
|
2015-12-29 12:08:58 +08:00
|
|
|
</div>, mountNode);
|
2015-12-10 16:41:41 +08:00
|
|
|
````
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#components-message-demo-other .ant-btn {
|
|
|
|
margin-right: 8px;
|
|
|
|
}
|
|
|
|
</style>
|