From 32bedc9a9d50f8a7cdf922ba09574729816d2302 Mon Sep 17 00:00:00 2001 From: binhaoCen Date: Fri, 21 Aug 2020 22:12:55 +0800 Subject: [PATCH] chore: update type tabs (#2740) --- types/tabs/tab-pane.d.ts | 35 ++++++------ types/tabs/tabs.d.ts | 114 ++++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 72 deletions(-) diff --git a/types/tabs/tab-pane.d.ts b/types/tabs/tab-pane.d.ts index 53cbec122..639649edd 100644 --- a/types/tabs/tab-pane.d.ts +++ b/types/tabs/tab-pane.d.ts @@ -3,24 +3,27 @@ // Definitions: https://github.com/vueComponent/ant-design-vue/types import { AntdComponent } from '../component'; +import { VNodeChild } from 'vue'; export declare class TabPane extends AntdComponent { - /** - * Forced render of content in tabs, not lazy render after clicking on tabs - * @default false - * @type boolean - */ - forceRender: boolean; + $props: { + /** + * Forced render of content in tabs, not lazy render after clicking on tabs + * @default false + * @type boolean + */ + forceRender?: boolean; - /** - * TabPane's key - * @type string - */ - key: string; + /** + * TabPane's key + * @type string + */ + key?: string; - /** - * Show text in TabPane's head - * @type any (string | slot) - */ - tab: any; + /** + * Show text in TabPane's head + * @type any (string | slot) + */ + tab?: VNodeChild | JSX.Element; + } } diff --git a/types/tabs/tabs.d.ts b/types/tabs/tabs.d.ts index e5f69fc62..7a9e4feb2 100644 --- a/types/tabs/tabs.d.ts +++ b/types/tabs/tabs.d.ts @@ -4,72 +4,74 @@ import { AntdComponent } from '../component'; import { TabPane } from './tab-pane'; +import { CSSProperties, VNodeChild } from 'vue'; export declare class Tabs extends AntdComponent { static TabPane: typeof TabPane; + $props: { + /** + * Current TabPane's key + * @type string + */ + activeKey?: string; - /** - * Current TabPane's key - * @type string - */ - activeKey: string; + /** + * Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom" + * @default true, false when type="card" + * @type boolean | object + */ + animated?: boolean | { inkBar: boolean; tabPane: boolean }; - /** - * Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom" - * @default true, false when type="card" - * @type boolean | object - */ - animated: boolean | { inkBar: boolean; tabPane: boolean }; + /** + * Initial active TabPane's key, if activeKey is not set. + * @type string + */ + defaultActiveKey?: string; - /** - * Initial active TabPane's key, if activeKey is not set. - * @type string - */ - defaultActiveKey: string; + /** + * Hide plus icon or not. Only works while type="editable-card" + * @default false + * @type boolean + */ + hideAdd?: boolean; - /** - * Hide plus icon or not. Only works while type="editable-card" - * @default false - * @type boolean - */ - hideAdd: boolean; + /** + * preset tab bar size + * @default 'default' + * @type string + */ + size?: 'default' | 'small' | 'large'; - /** - * preset tab bar size - * @default 'default' - * @type string - */ - size: 'default' | 'small' | 'large'; + /** + * Extra content in tab bar + * @type any + */ + tabBarExtraContent?: VNodeChild | JSX.Element; - /** - * Extra content in tab bar - * @type any - */ - tabBarExtraContent: any; + /** + * Tab bar style object + * @type object + */ + tabBarStyle?: CSSProperties; - /** - * Tab bar style object - * @type object - */ - tabBarStyle: object; + /** + * Position of tabs + * @default 'top' + * @type string + */ + tabPosition?: 'top' | 'right' | 'bottom' | 'left'; - /** - * Position of tabs - * @default 'top' - * @type string - */ - tabPosition: 'top' | 'right' | 'bottom' | 'left'; + /** + * Basic style of tabs + * @default 'line' + * @type string + */ + type?: 'line' | 'card' | 'editable-card'; - /** - * Basic style of tabs - * @default 'line' - * @type string - */ - type: 'line' | 'card' | 'editable-card'; - - /** - * The gap between tabs - * @type number - */ - tabBarGutter: number; + /** + * The gap between tabs + * @type number + */ + tabBarGutter?: number; + } }