mirror of https://github.com/wg-easy/wg-easy
committed by
GitHub
4 changed files with 31 additions and 20 deletions
@ -1,17 +1,32 @@ |
|||
<template> |
|||
<BaseFormSecondaryButton |
|||
as="input" |
|||
:value="label" |
|||
:type="type ?? 'button'" |
|||
class="col-span-2 py-2" |
|||
/> |
|||
:as="as" |
|||
:value="isInput ? label : undefined" |
|||
:type="isInput ? type : undefined" |
|||
class="col-span-2 px-4 py-2" |
|||
> |
|||
<template v-if="!isInput"> |
|||
{{ label }} |
|||
</template> |
|||
</BaseFormSecondaryButton> |
|||
</template> |
|||
|
|||
<script lang="ts" setup> |
|||
import type { InputTypeHTMLAttribute } from 'vue'; |
|||
|
|||
defineProps<{ |
|||
label: string; |
|||
type?: InputTypeHTMLAttribute; |
|||
}>(); |
|||
const props = withDefaults( |
|||
defineProps<{ |
|||
label: string; |
|||
type?: InputTypeHTMLAttribute; |
|||
as?: string; |
|||
}>(), |
|||
{ |
|||
type: 'button', |
|||
as: 'input', |
|||
} |
|||
); |
|||
|
|||
const isInput = computed(() => { |
|||
return props.as === 'input'; |
|||
}); |
|||
</script> |
|||
|
|||
Loading…
Reference in new issue