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 /**
* @default false * Forced render of content in tabs, not lazy render after clicking on tabs
* @type boolean * @default false
*/ * @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;
}
} }

114
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
* @type string
*/
activeKey?: string;
/** /**
* Current TabPane's key * Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom"
* @type string * @default true, false when type="card"
*/ * @type boolean | object
activeKey: string; */
animated?: boolean | { inkBar: boolean; tabPane: boolean };
/** /**
* Whether to change tabs with animation. Only works while tabPosition="top"\|"bottom" * Initial active TabPane's key, if activeKey is not set.
* @default true, false when type="card" * @type string
* @type boolean | object */
*/ defaultActiveKey?: string;
animated: boolean | { inkBar: boolean; tabPane: boolean };
/** /**
* Initial active TabPane's key, if activeKey is not set. * Hide plus icon or not. Only works while type="editable-card"
* @type string * @default false
*/ * @type boolean
defaultActiveKey: string; */
hideAdd?: boolean;
/** /**
* Hide plus icon or not. Only works while type="editable-card" * preset tab bar size
* @default false * @default 'default'
* @type boolean * @type string
*/ */
hideAdd: boolean; size?: 'default' | 'small' | 'large';
/** /**
* preset tab bar size * Extra content in tab bar
* @default 'default' * @type any
* @type string */
*/ tabBarExtraContent?: VNodeChild | JSX.Element;
size: 'default' | 'small' | 'large';
/** /**
* Extra content in tab bar * Tab bar style object
* @type any * @type object
*/ */
tabBarExtraContent: any; tabBarStyle?: CSSProperties;
/** /**
* Tab bar style object * Position of tabs
* @type object * @default 'top'
*/ * @type string
tabBarStyle: object; */
tabPosition?: 'top' | 'right' | 'bottom' | 'left';
/** /**
* Position of tabs * Basic style of tabs
* @default 'top' * @default 'line'
* @type string * @type string
*/ */
tabPosition: 'top' | 'right' | 'bottom' | 'left'; type?: 'line' | 'card' | 'editable-card';
/** /**
* Basic style of tabs * The gap between tabs
* @default 'line' * @type number
* @type string */
*/ tabBarGutter?: number;
type: 'line' | 'card' | 'editable-card'; }
/**
* The gap between tabs
* @type number
*/
tabBarGutter: number;
} }