fix. Circle 컴포넌트 bgColor props 추가
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user