优化按钮、loading的颜色

This commit is contained in:
icssoa
2025-08-08 11:28:28 +08:00
parent 3e59a31732
commit 853a661fe1
2 changed files with 15 additions and 5 deletions

View File

@@ -312,7 +312,13 @@ const emit = defineEmits([
]); ]);
const slots = useSlots(); const slots = useSlots();
const { cache } = useCache(() => [props.type, props.text, props.disabled, props.loading]); const { cache } = useCache(() => [
props.type,
props.text,
props.disabled,
props.loading,
props.color
]);
// 样式穿透类型 // 样式穿透类型
type PassThrough = { type PassThrough = {

View File

@@ -3,7 +3,7 @@
class="cl-loading" class="cl-loading"
:class="[ :class="[
{ {
'is-dark': isDark && color == '', 'cl-loading--dark': isDark && color == '',
'cl-loading--spin': loading, 'cl-loading--spin': loading,
'!border-primary-500': color == 'primary', '!border-primary-500': color == 'primary',
'!border-green-500': color == 'success', '!border-green-500': color == 'success',
@@ -23,7 +23,10 @@
// #endif // #endif
height: parseRpx(size!), height: parseRpx(size!),
width: parseRpx(size!), width: parseRpx(size!),
borderColor: color borderTopColor: color,
borderRightColor: 'transparent',
borderBottomColor: color,
borderLeftColor: color
}" }"
v-if="loading" v-if="loading"
> >
@@ -113,8 +116,9 @@ onMounted(() => {
@apply border-surface-700 border-solid; @apply border-surface-700 border-solid;
border-width: 2rpx; border-width: 2rpx;
&.is-dark { &--dark {
@apply border-white; border-color: white !important;
border-right-color: transparent !important;
} }
// #ifdef H5 || MP // #ifdef H5 || MP