mirror of
https://github.com/unraid/api.git
synced 2026-01-04 23:50:37 -06:00
fix: button component
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { XCircleIcon } from '@heroicons/vue/24/solid';
|
||||
export interface Props {
|
||||
click?: any; // @todo be more specific
|
||||
download?: boolean;
|
||||
external?: boolean;
|
||||
href?: string;
|
||||
@@ -13,6 +12,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
style: 'fill',
|
||||
});
|
||||
|
||||
defineEmits(['click']);
|
||||
|
||||
const classes = computed(() => {
|
||||
switch (props.style) {
|
||||
case 'fill':
|
||||
@@ -25,12 +26,12 @@ const classes = computed(() => {
|
||||
|
||||
<template>
|
||||
<component
|
||||
:is="click ? 'button' : 'a'"
|
||||
@click="click() ?? null"
|
||||
:is="href ? 'a' : 'button'"
|
||||
@click="$emit('click')"
|
||||
:href="href"
|
||||
:rel="external ? 'noopener noreferrer' : ''"
|
||||
:target="external ? '_blank' : ''"
|
||||
class="text-14px text-center w-full flex-none flex flex-row items-center justify-center gap-x-8px px-8px py-8px cursor-pointer rounded-md"
|
||||
class="text-14px text-center flex-none flex flex-row items-center justify-center gap-x-8px px-8px py-8px cursor-pointer rounded-md"
|
||||
:class="classes"
|
||||
>
|
||||
<component v-if="icon" :is="icon" class="flex-shrink-0 w-14px" />
|
||||
|
||||
Reference in New Issue
Block a user