Browse Source

keep .warn

pull/1924/head
yiminghe 9 years ago
parent
commit
fc55cf6919
  1. 1
      CHANGELOG.md
  2. 2
      components/message/index.jsx
  3. 1
      components/message/index.md
  4. 2
      components/modal/index.jsx
  5. 1
      components/modal/index.md
  6. 7
      components/notification/index.jsx
  7. 1
      components/notification/index.md

1
CHANGELOG.md

@ -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 修复

2
components/message/index.jsx

@ -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) {

1
components/message/index.md

@ -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)`
组件提供了四个静态方法,参数如下:

2
components/modal/index.jsx

@ -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',

1
components/modal/index.md

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

7
components/notification/index.jsx

@ -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;

1
components/notification/index.md

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

Loading…
Cancel
Save