2022-09-01 22:32:03 +00:00
|
|
|
<template>
|
|
|
|
<button
|
|
|
|
:disabled="disabled || loading"
|
|
|
|
class="btn"
|
2022-09-02 17:46:20 +00:00
|
|
|
ref="submitBtn"
|
2022-09-01 22:32:03 +00:00
|
|
|
:class="{
|
|
|
|
loading: loading,
|
|
|
|
}"
|
|
|
|
>
|
2022-09-02 17:46:20 +00:00
|
|
|
<label v-if="$slots.icon" class="swap swap-rotate mr-2" :class="{ 'swap-active': isHover }">
|
|
|
|
<slot name="icon" />
|
|
|
|
</label>
|
2022-09-01 22:32:03 +00:00
|
|
|
<slot />
|
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
defineProps({
|
|
|
|
loading: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
});
|
2022-09-02 17:46:20 +00:00
|
|
|
|
|
|
|
const submitBtn = ref(null);
|
|
|
|
const isHover = useElementHover(submitBtn);
|
2022-09-01 22:32:03 +00:00
|
|
|
</script>
|