Browse Source

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

pull/3198/head
feng zhi hao 8 years ago
committed by Benjy Cui
parent
commit
c0527f8b66
  1. 4
      components/pagination/MiniSelect.tsx
  2. 15
      components/select/index.tsx
  3. 4
      components/tabs/index.tsx

4
components/pagination/MiniSelect.tsx

@ -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} />;

15
components/select/index.tsx

@ -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',

4
components/tabs/index.tsx

@ -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',

Loading…
Cancel
Save