diff --git a/api-generator/components/button.js b/api-generator/components/button.js
index cc17ea7d34..5653509387 100644
--- a/api-generator/components/button.js
+++ b/api-generator/components/button.js
@@ -94,6 +94,12 @@ const ButtonProps = [
type: 'boolean',
default: 'false',
description: 'Add a plain textual class to the button without a background initially.'
+ },
+ {
+ name: 'pt',
+ type: 'any',
+ default: 'null',
+ description: 'Uses to pass attributes to DOM elements inside the component.'
}
];
diff --git a/components/lib/button/Button.d.ts b/components/lib/button/Button.d.ts
index 7d85f2b53b..f6955bb85e 100755
--- a/components/lib/button/Button.d.ts
+++ b/components/lib/button/Button.d.ts
@@ -10,6 +10,49 @@
import { ButtonHTMLAttributes, VNode } from 'vue';
import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
+export declare type ButtonPassThroughOptionType = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions) => ButtonPassThroughAttributes) | null | undefined;
+
+/**
+ * Custom passthrough(pt) option method.
+ */
+export interface ButtonPassThroughMethodOptions {
+ props: ButtonProps;
+}
+
+/**
+ * Custom passthrough(pt) options.
+ * @see {@link ButtonProps.pt}
+ */
+export interface ButtonPassThroughOptions {
+ /**
+ * Uses to pass attributes to the root's DOM element.
+ */
+ root?: ButtonPassThroughOptionType;
+ /**
+ * Uses to pass attributes to the loading icon's DOM element.
+ */
+ loadingIcon?: ButtonPassThroughOptionType;
+ /**
+ * Uses to pass attributes to the icon's DOM element.
+ */
+ icon?: ButtonPassThroughOptionType;
+ /**
+ * Uses to pass attributes to the label's DOM element.
+ */
+ label?: ButtonPassThroughOptionType;
+ /**
+ * Uses to pass attributes to the badge's DOM element.
+ */
+ badge?: ButtonPassThroughOptionType;
+}
+
+/**
+ * Custom passthrough attributes for each DOM elements
+ */
+export interface ButtonPassThroughAttributes {
+ [key: string]: any;
+}
+
/**
* Defines valid properties in Button component.
*/
@@ -94,6 +137,11 @@ export interface ButtonProps extends ButtonHTMLAttributes {
* @defaultValue false
*/
plain?: boolean | undefined;
+ /**
+ * Uses to pass attributes to DOM elements inside the component.
+ * @type {ButtonPassThroughOptions}
+ */
+ pt?: ButtonPassThroughOptions;
}
/**
diff --git a/components/lib/button/Button.vue b/components/lib/button/Button.vue
index 027b91ab07..03f69a80f4 100755
--- a/components/lib/button/Button.vue
+++ b/components/lib/button/Button.vue
@@ -1,26 +1,28 @@
-