From a31dad992c8f99aac483173e03e96ebb16216657 Mon Sep 17 00:00:00 2001 From: Zyy Date: Tue, 11 Aug 2026 17:21:16 +0800 Subject: [PATCH] fix(frontend): stabilize button loading indicator Co-authored-by: Codex --- frontend/src/components/base/BaseButton.vue | 28 +++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/base/BaseButton.vue b/frontend/src/components/base/BaseButton.vue index e46bd598a..1ad36a444 100644 --- a/frontend/src/components/base/BaseButton.vue +++ b/frontend/src/components/base/BaseButton.vue @@ -69,6 +69,14 @@ const loadingIconSize: Record = { lg: 17, } +const loadingIndicatorStyle = computed(() => { + const iconSize = loadingIconSize[props.size] + return { + width: `${iconSize}px`, + height: `${iconSize}px`, + } +}) + const classes = computed(() => [ 'inline-flex items-center justify-center border-0 font-bold leading-[1.15] transition-[background-color,box-shadow,color,opacity,transform] duration-150 cursor-pointer outline-none motion-safe:active:translate-y-px motion-safe:active:scale-[0.985]', props.iconOnly ? iconOnlySizeClasses[props.size] : sizeClasses[props.size], @@ -110,10 +118,26 @@ const labelClasses = computed(() => [ >