mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 13:09:40 +08:00
chore: complete declaration in Tabs and Select (#3183)
This commit is contained in:
parent
92fb8f266f
commit
c0527f8b66
@ -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} />;
|
||||
|
@ -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',
|
||||
|
@ -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…
Reference in New Issue
Block a user