keep .warn

This commit is contained in:
yiminghe 2016-05-31 15:29:24 +08:00
parent 8dff727a27
commit fc55cf6919
7 changed files with 5 additions and 10 deletions

View File

@ -115,7 +115,6 @@ timeline: true
- Progress.Circle 使用方式改为 `<Progress type="circle" />`
- Spin 的 `spining` 属性更正为 `spinning`
- Alert 的 type `warn` 重命名为 `warning`。[#1225](https://github.com/ant-design/ant-design/issues/1225)
- `notification.warn`、`message.warn` 修改为 `notification.warning``message.warning`。[#1225](https://github.com/ant-design/ant-design/issues/1225)
- Tree 的 `onExpand` 参数从 `function(node, expanded, expandedKeys)` 调整为 `function(expandedKeys, {expanded, node})`
### Bug 修复

View File

@ -1,7 +1,6 @@
import React from 'react';
import Notification from 'rc-notification';
import Icon from '../icon';
import warning from 'warning';
let defaultDuration = 1.5;
let defaultTop;
@ -60,7 +59,6 @@ export default {
},
// Departed usage, please use warning()
warn(content, duration, onClose) {
warning(false, 'message.warn() is departed, please use message.warning()');
return notice(content, duration, 'warning', onClose);
},
warning(content, duration, onClose) {

View File

@ -19,6 +19,7 @@ english: Message
- `message.error(content, duration)`
- `message.info(content, duration)`
- `message.warning(content, duration)`
- `message.warn(content, duration)`
- `message.loading(content, duration)`
组件提供了四个静态方法,参数如下:

View File

@ -31,7 +31,7 @@ Modal.error = function (props) {
return confirm(config);
};
Modal.warning = function (props) {
Modal.warning = Modal.warn = function (props) {
const config = {
type: 'warning',
iconType: 'exclamation-circle',

View File

@ -41,6 +41,7 @@ english: Modal
- `Modal.success`
- `Modal.error`
- `Modal.warning`
- `Modal.warn`
- `Modal.confirm`
以上均为一个函数,参数为 object具体属性如下

View File

@ -1,7 +1,6 @@
import React from 'react';
import Notification from 'rc-notification';
import Icon from '../icon';
import warning from 'warning';
let defaultTop = 24;
let notificationInstance;
@ -95,10 +94,6 @@ const api = {
api[type] = (args) => api.open({ ...args, icon: type });
});
// warn: Departed usage, please use warning()
api.warn = (...args) => {
warning(false, 'notification.warn() is departed, please use notification.warning()');
api.warning(...args);
};
api.warn = api.warning;
export default api;

View File

@ -22,6 +22,7 @@ english: Notification
- `notification.error(config)`
- `notification.info(config)`
- `notification.warning(config)`
- `notification.warn(config)`
- `notification.close(key: String)`
- `notification.destroy()`