2015-12-10 16:41:41 +08:00
|
|
|
# 其他提示类型
|
|
|
|
|
|
|
|
- order: 1
|
|
|
|
|
|
|
|
包括成功、失败、警告。
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````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-01-27 16:53:05 +08:00
|
|
|
const warn = function () {
|
2015-12-10 16:41:41 +08:00
|
|
|
message.warn('这是一条警告提示');
|
|
|
|
};
|
|
|
|
|
|
|
|
ReactDOM.render(<div>
|
|
|
|
<Button onClick={success}>显示成功提示</Button>
|
|
|
|
<Button onClick={error}>显示报错提示</Button>
|
|
|
|
<Button onClick={warn}>显示警告提示</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>
|