mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
Button: add text + icon props
This commit is contained in:
parent
85c787f428
commit
9b37078d79
2 changed files with 11 additions and 6 deletions
|
@ -1,13 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
variant?: string
|
||||
type?: HTMLButtonElement['type']
|
||||
text?: string
|
||||
variant?: string
|
||||
icon?: string
|
||||
block?: boolean
|
||||
}>(),
|
||||
{
|
||||
variant: 'primary',
|
||||
type: 'button',
|
||||
text: undefined,
|
||||
variant: 'primary',
|
||||
icon: undefined,
|
||||
block: false,
|
||||
},
|
||||
)
|
||||
|
@ -23,6 +27,9 @@ const variantClass = computed(() => {
|
|||
|
||||
<template>
|
||||
<button class="btn" :class="[variantClass, { 'btn-block': block }]">
|
||||
<slot name="default" />
|
||||
<slot name="default">
|
||||
<Icon v-if="icon" :name="icon" size="1.5em" aria-hidden="true" />
|
||||
{{ text }}
|
||||
</slot>
|
||||
</button>
|
||||
</template>
|
||||
|
|
|
@ -63,9 +63,7 @@ const schema = {
|
|||
/>
|
||||
</FormField>
|
||||
|
||||
<YButton type="submit" block>
|
||||
{{ t('login') }}
|
||||
</YButton>
|
||||
<YButton :text="t('login')" type="submit" block />
|
||||
</BaseForm>
|
||||
</main>
|
||||
</template>
|
||||
|
|
Loading…
Reference in a new issue