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> |
<template> |
||||
<BaseFormSecondaryButton |
<BaseFormSecondaryButton |
||||
as="input" |
:as="as" |
||||
:value="label" |
:value="isInput ? label : undefined" |
||||
:type="type ?? 'button'" |
:type="isInput ? type : undefined" |
||||
class="col-span-2 py-2" |
class="col-span-2 px-4 py-2" |
||||
/> |
> |
||||
|
<template v-if="!isInput"> |
||||
|
{{ label }} |
||||
|
</template> |
||||
|
</BaseFormSecondaryButton> |
||||
</template> |
</template> |
||||
|
|
||||
<script lang="ts" setup> |
<script lang="ts" setup> |
||||
import type { InputTypeHTMLAttribute } from 'vue'; |
import type { InputTypeHTMLAttribute } from 'vue'; |
||||
|
|
||||
defineProps<{ |
const props = withDefaults( |
||||
label: string; |
defineProps<{ |
||||
type?: InputTypeHTMLAttribute; |
label: string; |
||||
}>(); |
type?: InputTypeHTMLAttribute; |
||||
|
as?: string; |
||||
|
}>(), |
||||
|
{ |
||||
|
type: 'button', |
||||
|
as: 'input', |
||||
|
} |
||||
|
); |
||||
|
|
||||
|
const isInput = computed(() => { |
||||
|
return props.as === 'input'; |
||||
|
}); |
||||
</script> |
</script> |
||||
|
|||||
Loading…
Reference in new issue