This repository was archived by the owner on Sep 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-19
lines changed
.playground/src/pages/components
components/Button/__snapshots__ Expand file tree Collapse file tree 3 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ onMounted(() => {
3737
3838 <Button :label :color =" color" :loading =" isLoading" leading-icon =" i-lucide-info" trailing-icon =" i-lucide-info" />
3939
40+ <Button :label :color =" color" :loading =" isLoading" leading-icon =" i-lucide-info" />
41+
42+ <Button :label :color =" color" :loading =" isLoading" />
43+
4044 <Button :label :color =" color" block />
4145
4246 <Button :label :color =" color" href =" https://example.com" />
Original file line number Diff line number Diff line change @@ -396,8 +396,20 @@ exports[`button > renders with loading and avatar correctly 1`] = `
396396
397397
398398 <span
399- class = " inline-block i-lucide-loader shrink-0 size-5 opacity-0"
400- />
399+ class = " inline-flex items-center justify-center select-none overflow-hidden rounded-full align-middle bg-elevated size-5 text-[10px] shrink-0"
400+ >
401+
402+ <img
403+ class = " h-full w-full rounded-[inherit] object-cover"
404+ role = " img"
405+ src = " https://github.com/vuejs.png"
406+ style = " display: none;"
407+ />
408+ <span
409+ class = " font-medium leading-none text-muted truncate"
410+ />
411+
412+ </span >
401413
402414
403415 <!--v-if-->
@@ -423,9 +435,7 @@ exports[`button > renders with loading correctly 1`] = `
423435>
424436
425437
426- <span
427- class = " inline-block i-lucide-loader shrink-0 size-5 opacity-0"
428- />
438+ <!--v-if-->
429439
430440
431441 <!--v-if-->
@@ -471,9 +481,7 @@ exports[`button > renders with loading trailing and avatar correctly 1`] = `
471481 <!--v-if-->
472482
473483
474- <span
475- class = " inline-block i-lucide-loader shrink-0 size-5 opacity-0"
476- />
484+ <!--v-if-->
477485
478486
479487 <span
@@ -499,9 +507,7 @@ exports[`button > renders with loading trailing correctly 1`] = `
499507 <!--v-if-->
500508
501509
502- <span
503- class = " inline-block i-lucide-loader shrink-0 size-5 opacity-0"
504- />
510+ <!--v-if-->
505511
506512
507513 <span
@@ -522,9 +528,7 @@ exports[`button > renders with loadingIcon correctly 1`] = `
522528>
523529
524530
525- <span
526- class = " inline-block i-lucide-loader shrink-0 size-5 opacity-0"
527- />
531+ <!--v-if-->
528532
529533
530534 <!--v-if-->
Original file line number Diff line number Diff line change 11import type { AvatarProps } from '@/ui/components/Avatar/Avatar.vue'
22import type { MaybeRefOrGetter } from 'vue'
3- import { loadingIcon } from '@/ui/icons'
43import { computed , toValue } from 'vue'
54
65export interface UseComponentIconsProps {
@@ -16,20 +15,20 @@ export interface UseComponentIconsProps {
1615export function useComponentIcons ( componentProps : MaybeRefOrGetter < UseComponentIconsProps > ) {
1716 const props = computed ( ( ) => toValue ( componentProps ) )
1817
19- const isLeading = computed ( ( ) => ( props . value . icon && props . value . leading ) || ( props . value . icon && ! props . value . trailing ) || ( props . value . loading && ! props . value . trailing ) || ! ! props . value . leadingIcon )
20- const isTrailing = computed ( ( ) => ( props . value . icon && props . value . trailing ) || ( props . value . loading && props . value . trailing ) || ! ! props . value . trailingIcon )
18+ const isLeading = computed ( ( ) => ( props . value . icon && props . value . leading ) || ( props . value . icon && ! props . value . trailing ) || ! ! props . value . leadingIcon )
19+ const isTrailing = computed ( ( ) => ( props . value . icon && props . value . trailing ) || ! ! props . value . trailingIcon )
2120
2221 const leadingIconName = computed ( ( ) => {
2322 if ( props . value . loading ) {
24- return loadingIcon
23+ return ''
2524 }
2625
2726 return props . value . leadingIcon || props . value . icon
2827 } )
2928
3029 const trailingIconName = computed ( ( ) => {
3130 if ( props . value . loading ) {
32- return loadingIcon
31+ return ''
3332 }
3433
3534 return props . value . trailingIcon || props . value . icon
You can’t perform that action at this time.
0 commit comments