✨ Add support for slot detection in BaseButton component
This commit is contained in:
@@ -103,6 +103,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['click']);
|
const emit = defineEmits(['click']);
|
||||||
|
const slots = useSlots();
|
||||||
|
|
||||||
const buttonClasses = computed(() => [
|
const buttonClasses = computed(() => [
|
||||||
'base-button',
|
'base-button',
|
||||||
@@ -113,7 +114,7 @@ const buttonClasses = computed(() => [
|
|||||||
'base-button--disabled': props.disabled,
|
'base-button--disabled': props.disabled,
|
||||||
'base-button--full-width': props.fullWidth,
|
'base-button--full-width': props.fullWidth,
|
||||||
'base-button--icon-only':
|
'base-button--icon-only':
|
||||||
props.variant === 'icon-only' || (!props.$slots.default && props.icon)
|
props.variant === 'icon-only' || (!slots.default && props.icon)
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user