Browse Source

Merge pull request #2167 from RaoHai/rewriteCollapseInTs

rewrite collapse in typescript
pull/2108/merge
yiminghe 9 years ago
committed by GitHub
parent
commit
a3fc8b052f
  1. 29
      components/collapse/index.tsx
  2. 5
      components/index.tsx

29
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> | 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;
static defaultProps = {
prefixCls: 'ant-collapse',

5
components/index.tsx

@ -1,2 +1,5 @@
import Affix from './affix';
export { Affix };
export { Affix };
import Collapse from './collapse';
export { Collapse };
Loading…
Cancel
Save