mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
keep .warn
This commit is contained in:
parent
8dff727a27
commit
fc55cf6919
@ -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 修复
|
||||
|
@ -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) {
|
||||
|
@ -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)`
|
||||
|
||||
组件提供了四个静态方法,参数如下:
|
||||
|
@ -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',
|
||||
|
@ -41,6 +41,7 @@ english: Modal
|
||||
- `Modal.success`
|
||||
- `Modal.error`
|
||||
- `Modal.warning`
|
||||
- `Modal.warn`
|
||||
- `Modal.confirm`
|
||||
|
||||
以上均为一个函数,参数为 object,具体属性如下:
|
||||
|
@ -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;
|
||||
|
@ -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…
Reference in New Issue
Block a user