fix. [SWV-866] 액션버튼 기능 개선

This commit is contained in:
clkim
2026-03-10 15:41:20 +09:00
parent e594231686
commit 532b9b6855
4 changed files with 19 additions and 8 deletions

View File

@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { ImageButtonType } from '#layers/types/components/button'
import type { ButtonType } from '#layers/types/components/button'
interface props {
type?: ImageButtonType
type?: ButtonType
href?: string
backgroundImage: string
alt: string
@@ -18,13 +18,14 @@ const componentTag = computed((): string => {
switch (props.type) {
case 'external':
return 'a'
case 'download':
return props.href ? 'a' : 'button'
case 'internal':
return 'AtomsLocaleLink'
default:
return 'button'
}
})
const componentProps = computed(() => {
if (props.type === 'external') {
return {
@@ -43,6 +44,17 @@ const componentProps = computed(() => {
return {}
}
if (props.type === 'download') {
if (props.href) {
return {
href: props.href,
target: '_self',
download: props.href?.split('/').pop() ?? 'download',
}
}
return {}
}
return {}
})
const buttonStyle = computed(() => {