Browse Source

chore: 迁移 modal iconfont

- api 接口有变
pull/361/head
elrrrrrrr 9 years ago
parent
commit
244c3a78a5
  1. 7
      components/modal/confirm.jsx
  2. 6
      components/modal/index.jsx
  3. 2
      components/modal/index.md

7
components/modal/confirm.jsx

@ -1,5 +1,6 @@
import React from 'react';
import Dialog from './index';
import Icon from '../iconfont';
export default function (props) {
let div = document.createElement('div');
@ -7,7 +8,9 @@ export default function (props) {
let d;
props = props || {};
props.iconClassName = props.iconClassName || 'anticon-question-circle';
props.iconClassName = props.iconClassName || 'question-circle';
let iconClassType = props.iconClassName;
let width = props.width || 416;
// true
@ -63,7 +66,7 @@ export default function (props) {
}
let body = <div className="ant-confirm-body">
<i className={'anticon ' + props.iconClassName}></i>
<Icon type={iconClassType} />
<span className="ant-confirm-title">{props.title}</span>
<div className="ant-confirm-content">{props.content}</div>
</div>;

6
components/modal/index.jsx

@ -92,19 +92,19 @@ let AntModal = React.createClass({
});
AntModal.info = function (props) {
props.iconClassName = 'anticon-info-circle';
props.iconClassName = 'info-circle';
props.okCancel = false;
return confirm(props);
};
AntModal.success = function (props) {
props.iconClassName = 'anticon-check-circle';
props.iconClassName = 'check-circle';
props.okCancel = false;
return confirm(props);
};
AntModal.error = function (props) {
props.iconClassName = 'anticon-exclamation-circle';
props.iconClassName = 'exclamation-circle';
props.okCancel = false;
return confirm(props);
};

2
components/modal/index.md

@ -46,7 +46,7 @@
| onOk | 点击确定回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 |
| onCancel | 取消回调,参数为关闭函数,返回 promise 时 resolve 后自动关闭 | function | 无 |
| width | 宽度 | String or Number | 416 |
| iconClassName | 图标样式名 | String | anticon-question-circle |
| iconClassName | 图标 Icon 类型 | String | question-circle |
<style>
.code-box-demo .ant-btn {

Loading…
Cancel
Save