fix. [SWV-866] 액션버튼 기능 개선
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user