From 2d20f4fada2216e86bd74988a490cb05ea06605a Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 20 Sep 2024 15:41:25 +0800 Subject: [PATCH] * button: support for setting text class to button. --- lib/button/src/component/button.tsx | 4 ++-- lib/button/src/types/button-props.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/button/src/component/button.tsx b/lib/button/src/component/button.tsx index d817f4e3b2..7f3e56d303 100644 --- a/lib/button/src/component/button.tsx +++ b/lib/button/src/component/button.tsx @@ -16,10 +16,10 @@ export class Button

extends HElement

{ } protected _getChildren(props: RenderableProps

) { - const {loading, loadingIcon, loadingText, icon, iconClass, text, children, trailingIcon, trailingIconClass, caret} = props; + const {loading, loadingIcon, loadingText, icon, iconClass, text, textClass, children, trailingIcon, trailingIconClass, caret} = props; return [ loading ? : , - this._isEmptyText ? null : {loading ? loadingText : text}, + this._isEmptyText ? null : {loading ? loadingText : text}, loading ? null : children, loading ? null : , loading ? null : caret ? : null, diff --git a/lib/button/src/types/button-props.ts b/lib/button/src/types/button-props.ts index 9ff5f9184a..3a6da5007c 100644 --- a/lib/button/src/types/button-props.ts +++ b/lib/button/src/types/button-props.ts @@ -14,6 +14,7 @@ export interface ButtonProps extends HElementProps { icon?: IconType; iconClass?: ClassNameLike; text?: ComponentChildren; + textClass?: ClassNameLike; square?: boolean; trailingIcon?: IconType; trailingIconClass?: ClassNameLike;