chore: update type tabs (#2740)

pull/2750/head
binhaoCen 2020-08-21 22:12:55 +08:00 committed by GitHub
parent 8694abf14b
commit 32bedc9a9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 77 additions and 72 deletions

View File

@ -3,24 +3,27 @@
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { AntdComponent } from '../component'; import { AntdComponent } from '../component';
import { VNodeChild } from 'vue';
export declare class TabPane extends AntdComponent { export declare class TabPane extends AntdComponent {
$props: {
/** /**
* Forced render of content in tabs, not lazy render after clicking on tabs * Forced render of content in tabs, not lazy render after clicking on tabs
* @default false * @default false
* @type boolean * @type boolean
*/ */
forceRender: boolean; forceRender?: boolean;
/** /**
* TabPane's key * TabPane's key
* @type string * @type string
*/ */
key: string; key?: string;
/** /**
* Show text in TabPane's head * Show text in TabPane's head
* @type any (string | slot) * @type any (string | slot)
*/ */
tab: any; tab?: VNodeChild | JSX.Element;
}
} }

24
types/tabs/tabs.d.ts vendored
View File

@ -4,72 +4,74 @@
import { AntdComponent } from '../component'; import { AntdComponent } from '../component';
import { TabPane } from './tab-pane'; import { TabPane } from './tab-pane';
import { CSSProperties, VNodeChild } from 'vue';
export declare class Tabs extends AntdComponent { export declare class Tabs extends AntdComponent {
static TabPane: typeof TabPane; static TabPane: typeof TabPane;
$props: {
/** /**
* Current TabPane's key * Current TabPane's key
* @type string * @type string
*/ */
activeKey: string; activeKey?: string;
/** /**
* Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom" * Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom"
* @default true, false when type="card" * @default true, false when type="card"
* @type boolean | object * @type boolean | object
*/ */
animated: boolean | { inkBar: boolean; tabPane: boolean }; animated?: boolean | { inkBar: boolean; tabPane: boolean };
/** /**
* Initial active TabPane's key, if activeKey is not set. * Initial active TabPane's key, if activeKey is not set.
* @type string * @type string
*/ */
defaultActiveKey: string; defaultActiveKey?: string;
/** /**
* Hide plus icon or not. Only works while type="editable-card" * Hide plus icon or not. Only works while type="editable-card"
* @default false * @default false
* @type boolean * @type boolean
*/ */
hideAdd: boolean; hideAdd?: boolean;
/** /**
* preset tab bar size * preset tab bar size
* @default 'default' * @default 'default'
* @type string * @type string
*/ */
size: 'default' | 'small' | 'large'; size?: 'default' | 'small' | 'large';
/** /**
* Extra content in tab bar * Extra content in tab bar
* @type any * @type any
*/ */
tabBarExtraContent: any; tabBarExtraContent?: VNodeChild | JSX.Element;
/** /**
* Tab bar style object * Tab bar style object
* @type object * @type object
*/ */
tabBarStyle: object; tabBarStyle?: CSSProperties;
/** /**
* Position of tabs * Position of tabs
* @default 'top' * @default 'top'
* @type string * @type string
*/ */
tabPosition: 'top' | 'right' | 'bottom' | 'left'; tabPosition?: 'top' | 'right' | 'bottom' | 'left';
/** /**
* Basic style of tabs * Basic style of tabs
* @default 'line' * @default 'line'
* @type string * @type string
*/ */
type: 'line' | 'card' | 'editable-card'; type?: 'line' | 'card' | 'editable-card';
/** /**
* The gap between tabs * The gap between tabs
* @type number * @type number
*/ */
tabBarGutter: number; tabBarGutter?: number;
}
} }