diff --git a/api-generator/components/divider.js b/api-generator/components/divider.js index 99e46a677..8d2686095 100644 --- a/api-generator/components/divider.js +++ b/api-generator/components/divider.js @@ -16,6 +16,12 @@ const DividerProps = [ type: 'string', default: 'solid', description: 'Border style type, default is "solid" and other options are "dashed" and "dotted".' + }, + { + name: 'pt', + type: 'any', + default: 'null', + description: 'Uses to pass attributes to DOM elements inside the component.' } ]; diff --git a/components/lib/divider/Divider.d.ts b/components/lib/divider/Divider.d.ts index 191758c12..1273c531f 100644 --- a/components/lib/divider/Divider.d.ts +++ b/components/lib/divider/Divider.d.ts @@ -10,6 +10,37 @@ import { VNode } from 'vue'; import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type DividerPassThroughOptionType = DividerPassThroughAttributes | ((options: DividerPassThroughMethodOptions) => DividerPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface DividerPassThroughMethodOptions { + props: DividerProps; +} + +/** + * Custom passthrough(pt) options. + * @see {@link DividerProps.pt} + */ +export interface DividerPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: DividerPassThroughOptionType; + /** + * Uses to pass attributes to the content's DOM element. + */ + content?: DividerPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface DividerPassThroughAttributes { + [key: string]: any; +} + /** * Defines valid properties in Divider component. */ @@ -28,6 +59,11 @@ export interface DividerProps { * @defaultValue solid */ type?: 'solid' | 'dashed' | 'dotted' | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {DividerPassThroughOptions} + */ + pt?: DividerPassThroughOptions; } /** diff --git a/components/lib/divider/Divider.vue b/components/lib/divider/Divider.vue index 421f4ef72..f7876d0cd 100644 --- a/components/lib/divider/Divider.vue +++ b/components/lib/divider/Divider.vue @@ -1,14 +1,16 @@