2016-03-21 21:16:38 +08:00
|
|
|
import RcCollapse from 'rc-collapse';
|
2016-06-30 10:05:29 +08:00
|
|
|
import * as React from 'react';
|
2015-07-11 10:17:58 +08:00
|
|
|
|
2016-06-24 15:20:48 +08:00
|
|
|
export interface CollapseProps {
|
|
|
|
activeKey?:Array<string> | string,
|
|
|
|
/** 初始化选中面板的key */
|
|
|
|
defaultActiveKey?:Array<string>,
|
|
|
|
/** 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<CollapsePanelProps, {}> {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default class Collapse extends React.Component<CollapseProps, any> {
|
|
|
|
static Panel: typeof CollapsePanel = RcCollapse.Panel;
|
2016-03-29 14:01:10 +08:00
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
prefixCls: 'ant-collapse',
|
|
|
|
}
|
|
|
|
|
2015-07-11 10:17:58 +08:00
|
|
|
render() {
|
2016-03-21 21:16:38 +08:00
|
|
|
return <RcCollapse {...this.props} />;
|
2015-07-11 10:17:58 +08:00
|
|
|
}
|
|
|
|
}
|