mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-21 06:16:31 +00:00
31 lines
583 B
Vue
31 lines
583 B
Vue
<template>
|
|
<button
|
|
:disabled="disabled || loading"
|
|
class="btn"
|
|
ref="submitBtn"
|
|
:class="{
|
|
loading: loading,
|
|
}"
|
|
>
|
|
<label v-if="$slots.icon" class="swap swap-rotate mr-2" :class="{ 'swap-active': isHover }">
|
|
<slot name="icon" />
|
|
</label>
|
|
<slot />
|
|
</button>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineProps({
|
|
loading: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
});
|
|
|
|
const submitBtn = ref(null);
|
|
const isHover = useElementHover(submitBtn);
|
|
</script>
|