From 71fef9c5ed16a89b71a5be74c72bc3e95ac7b0ee Mon Sep 17 00:00:00 2001 From: Creo-KR Date: Fri, 16 Aug 2024 16:35:42 +0900 Subject: [PATCH 1/2] Update BaseButton.vue make that "as" of Button Props can be assigned Component Object. --- packages/primevue/src/button/BaseButton.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/primevue/src/button/BaseButton.vue b/packages/primevue/src/button/BaseButton.vue index 3ae70885c..407da43d0 100644 --- a/packages/primevue/src/button/BaseButton.vue +++ b/packages/primevue/src/button/BaseButton.vue @@ -43,7 +43,7 @@ export default { default: undefined }, as: { - type: String, + type: [String, Object], default: 'BUTTON' }, asChild: { From 75725352d2ae3436d88c9883e7409e8030bc169e Mon Sep 17 00:00:00 2001 From: Creo-KR Date: Fri, 16 Aug 2024 16:37:31 +0900 Subject: [PATCH 2/2] Update Button.d.ts make that "as" of Button Props can be assigned Component Object. --- packages/primevue/src/button/Button.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/primevue/src/button/Button.d.ts b/packages/primevue/src/button/Button.d.ts index 3b309f6f1..19809034f 100755 --- a/packages/primevue/src/button/Button.d.ts +++ b/packages/primevue/src/button/Button.d.ts @@ -10,7 +10,7 @@ import type { DefineComponent, DesignToken, EmitFn, GlobalComponentConstructor, HintedString, PassThrough } from '@primevue/core'; import type { ComponentHooks } from '@primevue/core/basecomponent'; import type { PassThroughOptions } from 'primevue/passthrough'; -import { ButtonHTMLAttributes, VNode } from 'vue'; +import { ButtonHTMLAttributes, Component, VNode } from 'vue'; export declare type ButtonPassThroughOptionType = ButtonPassThroughAttributes | ((options: ButtonPassThroughMethodOptions) => ButtonPassThroughAttributes | string) | string | null | undefined; @@ -133,7 +133,7 @@ export interface ButtonProps extends ButtonHTMLAttributes { * Use to change the HTML tag of root element. * @defaultValue BUTTON */ - as?: string | undefined; + as?: string | Component | undefined; /** * When enabled, it changes the default rendered element for the one passed as a child element. * @defaultValue false