chore: complete declaration in Tabs and Select (#3183)

This commit is contained in:
feng zhi hao 2016-09-28 16:58:14 +08:00 committed by Benjy Cui
parent 92fb8f266f
commit c0527f8b66
3 changed files with 16 additions and 7 deletions

View File

@ -1,8 +1,8 @@
import React from 'react';
import Select from '../select';
import Select, { OptionProps } from '../select';
export default class MiniSelect extends React.Component<any, any> {
static Option = Select.Option;
static Option = Select.Option as React.ClassicComponentClass<OptionProps>;
render() {
return <Select size="small" {...this.props} />;

View File

@ -37,17 +37,26 @@ export interface SelectProps {
onChange?: (value) => void;
}
export interface OptionProps {
disabled?: boolean;
value?: any;
}
export interface OptGroupProps {
label?: string | React.ReactElement<any>;
}
export interface SelectContext {
antLocale?: {
Select?: any,
};
}
export { Option, OptGroup }
export { Option, OptGroup };
export default class Select extends React.Component<SelectProps, any> {
static Option = Option;
static OptGroup = OptGroup;
static Option = Option as React.ClassicComponentClass<OptionProps>;
static OptGroup = OptGroup as React.ClassicComponentClass<OptGroupProps>;
static defaultProps = {
prefixCls: 'ant-select',

View File

@ -29,12 +29,12 @@ export interface TabsProps {
// Tabs
export interface TabPaneProps {
/** 选项卡头显示文字 */
tab: React.ReactNode | string;
tab?: React.ReactNode | string;
style?: React.CSSProperties;
}
export default class Tabs extends React.Component<TabsProps, any> {
static TabPane: TabPaneProps = TabPane;
static TabPane = TabPane as React.ClassicComponentClass<TabPaneProps>;
static defaultProps = {
prefixCls: 'ant-tabs',