fix. [SWV-866] 액션버튼 기능 개선 (이미지 타입 추가)
Made-with: Cursor
This commit is contained in:
@@ -1,32 +1,45 @@
|
||||
<script setup lang="ts">
|
||||
interface props {
|
||||
<<<<<<< HEAD
|
||||
type?: 'button' | 'link'
|
||||
to?: string
|
||||
target?: '_self' | '_blank'
|
||||
=======
|
||||
type?: 'internal' | 'external' | 'action'
|
||||
href?: string
|
||||
>>>>>>> feature/20250228_SWV-866
|
||||
backgroundColor?: string
|
||||
srOnly?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<props>(), {
|
||||
<<<<<<< HEAD
|
||||
type: 'button',
|
||||
to: '',
|
||||
target: '_self',
|
||||
=======
|
||||
type: 'action',
|
||||
>>>>>>> feature/20250228_SWV-866
|
||||
backgroundColor: '',
|
||||
srOnly: '',
|
||||
})
|
||||
|
||||
const componentTag = computed((): string => {
|
||||
switch (props.type) {
|
||||
case 'link':
|
||||
case 'internal':
|
||||
return 'AtomsLocaleLink'
|
||||
case 'external':
|
||||
return 'a'
|
||||
default:
|
||||
return 'button'
|
||||
}
|
||||
})
|
||||
const componentProps = computed(() => {
|
||||
switch (props.type) {
|
||||
case 'link':
|
||||
return { to: props.to, target: props.target }
|
||||
case 'internal':
|
||||
return { to: props.href, target: '_self' }
|
||||
case 'external':
|
||||
return { href: props.href, target: '_blank' }
|
||||
default:
|
||||
return {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user