diff --git a/components/lib/slider/Slider.d.ts b/components/lib/slider/Slider.d.ts index c31c7b4d9..cd395f4d9 100755 --- a/components/lib/slider/Slider.d.ts +++ b/components/lib/slider/Slider.d.ts @@ -9,6 +9,49 @@ */ import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers'; +export declare type SliderPassThroughOptionType = SliderPassThroughAttributes | ((options: SliderPassThroughMethodOptions) => SliderPassThroughAttributes) | null | undefined; + +/** + * Custom passthrough(pt) option method. + */ +export interface SliderPassThroughMethodOptions { + props: SliderProps; +} + +/** + * Custom passthrough(pt) options. + * @see {@link SliderProps.pt} + */ +export interface SliderPassThroughOptions { + /** + * Uses to pass attributes to the root's DOM element. + */ + root?: SliderPassThroughOptionType; + /** + * Uses to pass attributes to the range's DOM element. + */ + range?: SliderPassThroughOptionType; + /** + * Uses to pass attributes to the handle's DOM element. + */ + handle?: SliderPassThroughOptionType; + /** + * Uses to pass attributes to the start handler's DOM element. + */ + startHandler?: SliderPassThroughOptionType; + /** + * Uses to pass attributes to the end handler's DOM element. + */ + endHandler?: SliderPassThroughOptionType; +} + +/** + * Custom passthrough attributes for each DOM elements + */ +export interface SliderPassThroughAttributes { + [key: string]: any; +} + /** * Custom slide end event. * @see {@link SliderEmits.slideend} @@ -74,6 +117,11 @@ export interface SliderProps { * Used to define a string that labels the element. */ 'aria-label'?: string | undefined; + /** + * Uses to pass attributes to DOM elements inside the component. + * @type {SliderPassThroughOptions} + */ + pt?: SliderPassThroughOptions; } /** diff --git a/components/lib/slider/Slider.vue b/components/lib/slider/Slider.vue index c94637b92..a9a133577 100755 --- a/components/lib/slider/Slider.vue +++ b/components/lib/slider/Slider.vue @@ -1,6 +1,6 @@ diff --git a/doc/slider/pt/PTImage.vue b/doc/slider/pt/PTImage.vue new file mode 100644 index 000000000..9ac50d6b4 --- /dev/null +++ b/doc/slider/pt/PTImage.vue @@ -0,0 +1,8 @@ + diff --git a/doc/slider/pt/index.vue b/doc/slider/pt/index.vue new file mode 100644 index 000000000..b70472fae --- /dev/null +++ b/doc/slider/pt/index.vue @@ -0,0 +1,41 @@ + + + diff --git a/pages/slider/index.vue b/pages/slider/index.vue index 79b7a1708..803e0fa68 100755 --- a/pages/slider/index.vue +++ b/pages/slider/index.vue @@ -1,5 +1,5 @@