修复 FaSwitch 图标不居中

This commit is contained in:
Hooray
2025-09-22 16:33:31 +08:00
parent 3b2f69d127
commit fda3adf95a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ const enabled = defineModel<boolean>()
<template>
<Switch v-model="enabled" :disabled>
<template #thumb>
<FaIcon v-if="(enabled && onIcon) || (!enabled && offIcon)" :name="(enabled ? onIcon : offIcon) as string" class="h-3 w-3 text-foreground" />
<FaIcon v-if="(enabled && onIcon) || (!enabled && offIcon)" :name="(enabled ? onIcon : offIcon) as string" class="size-3 text-foreground" />
</template>
</Switch>
</template>
+1 -1
View File
@@ -27,7 +27,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
)"
>
<SwitchThumb
:class="cn('pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 rtl:data-[state=checked]:-translate-x-5')"
:class="cn('pointer-events-none flex-center h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 rtl:data-[state=checked]:-translate-x-5')"
>
<slot name="thumb" />
</SwitchThumb>