fix. Circle 컴포넌트 bgColor props 추가

This commit is contained in:
clkim
2026-02-12 10:30:55 +09:00
parent 2d4dece0f4
commit 78133cbc05
8 changed files with 37 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ interface props {
type?: 'button' | 'link'
to?: string
target?: '_self' | '_blank'
bgColor?: string
srOnly?: string
}
@@ -10,6 +11,7 @@ const props = withDefaults(defineProps<props>(), {
type: 'button',
to: '',
target: '_self',
bgColor: '',
srOnly: '',
})
@@ -29,10 +31,23 @@ const componentProps = computed(() => {
return {}
}
})
const buttonStyle = computed(() => {
const style: Record<string, string> = {}
if (props.bgColor) {
style.backgroundColor = props.bgColor
}
return style
})
</script>
<template>
<component :is="componentTag" v-bind="componentProps" class="btn-circle">
<component
:is="componentTag"
v-bind="componentProps"
class="btn-circle"
:style="buttonStyle"
>
<span class="icon">
<slot />
</span>