feat: change Button component to be a button and not a div, and made callback optional
This commit is contained in:
parent
dac473e9fb
commit
491e736422
1 changed files with 5 additions and 3 deletions
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div @click="props.callback()" class="button" :class="props.variant + '-button'">
|
<button @click="props.callback ? props.callback() : null" class="button" :class="props.variant + '-button'">
|
||||||
{{ props.text }}
|
{{ props.text }}
|
||||||
</div>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
text: string,
|
text: string,
|
||||||
callback: CallableFunction,
|
callback?: CallableFunction,
|
||||||
variant?: "normal" | "scary" | "neutral",
|
variant?: "normal" | "scary" | "neutral",
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ const props = defineProps<{
|
||||||
border-radius: 0.7rem;
|
border-radius: 0.7rem;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:hover {
|
.button:hover {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue