diff --git a/components/collapse/index.tsx b/components/collapse/index.tsx index 4ee23dd2d2..82e5d0a978 100644 --- a/components/collapse/index.tsx +++ b/components/collapse/index.tsx @@ -1,8 +1,33 @@ import RcCollapse from 'rc-collapse'; import React from 'react'; -export default class Collapse extends React.Component { - static Panel = RcCollapse.Panel; +export interface CollapseProps { + activeKey?:Array | string, + /** 初始化选中面板的key */ + defaultActiveKey?:Array, + /** accordion 为 true 的时候,一次只可以打开一个面板 */ + accordion?:boolean, + /** 切换面板的回调*/ + onChange?:(key:string) => void, + + style?:React.CSSProperties +} + +interface CollapsePanelProps { + /** 对应 activeKey */ + key:string, + /** 面板头内容*/ + header:React.ReactNode, + + style?:React.CSSProperties +} + +declare class CollapsePanel extends React.Component { + +} + +export default class Collapse extends React.Component { + static Panel: typeof CollapsePanel = RcCollapse.Panel; static defaultProps = { prefixCls: 'ant-collapse', diff --git a/components/index.tsx b/components/index.tsx index 48fc53d391..4dc1f267e2 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -1,2 +1,5 @@ import Affix from './affix'; -export { Affix }; \ No newline at end of file +export { Affix }; + +import Collapse from './collapse'; +export { Collapse }; \ No newline at end of file