mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
YButton: use link instead of button if used as navigation
This commit is contained in:
parent
bba01d685b
commit
535dd0e0c5
1 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { NuxtLink } from '#components'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
type?: 'button' | 'submit' | 'reset'
|
||||
|
@ -33,10 +35,11 @@ const variantClass = computed(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<button
|
||||
<component
|
||||
:is="$attrs.to ? NuxtLink : 'button'"
|
||||
class="btn"
|
||||
:class="[variantClass, { 'btn-block': block }]"
|
||||
:type="type"
|
||||
:type="$attrs.to ? null : type"
|
||||
>
|
||||
<slot name="default">
|
||||
<Icon
|
||||
|
@ -48,5 +51,5 @@ const variantClass = computed(() => {
|
|||
/>
|
||||
<span :class="{ 'sr-only': iconOnly }">{{ text }}</span>
|
||||
</slot>
|
||||
</button>
|
||||
</component>
|
||||
</template>
|
||||
|
|
Loading…
Add table
Reference in a new issue