浏览代码

add proptypes for Description

ddcat1115 8 年之前
父节点
当前提交
d9d02c3573
共有 1 个文件被更改,包括 17 次插入0 次删除
  1. 17 0
      src/components/DescriptionList/Description.js

+ 17 - 0
src/components/DescriptionList/Description.js

@@ -1,4 +1,5 @@
 import React from 'react';
 import React from 'react';
+import PropTypes from 'prop-types';
 import classNames from 'classnames';
 import classNames from 'classnames';
 import { Col } from 'antd';
 import { Col } from 'antd';
 import styles from './index.less';
 import styles from './index.less';
@@ -14,4 +15,20 @@ const Description = ({ term, column, className, children, ...restProps }) => {
   );
   );
 };
 };
 
 
+Description.defaultProps = {
+  term: '',
+  children: '',
+};
+
+Description.propTypes = {
+  term: PropTypes.oneOfType([
+    PropTypes.string,
+    PropTypes.element,
+  ]),
+  children: PropTypes.oneOfType([
+    PropTypes.string,
+    PropTypes.element,
+  ]),
+};
+
 export default Description;
 export default Description;