jws-frontend/src/components/ButtonAddCompoent.vue

51 lines
952 B
Vue
Raw Normal View History

2024-09-27 13:49:40 +07:00
<script setup lang="ts">
defineProps<{
hideIcon?: boolean;
}>();
</script>
2024-06-13 14:55:49 +07:00
<template>
2024-07-05 11:29:51 +07:00
<q-page-sticky position="bottom-right" :offset="[8, 8]">
2024-06-14 13:41:32 +07:00
<q-fab
2024-09-27 15:40:52 +07:00
v-if="!hideIcon"
2024-06-14 13:41:32 +07:00
id="btn-add"
2024-07-26 16:22:31 +07:00
padding="sm"
2024-06-14 13:41:32 +07:00
icon="mdi-plus"
direction="up"
2024-07-30 14:53:05 +07:00
class="color-btn"
2024-06-14 13:41:32 +07:00
>
2024-07-05 11:29:51 +07:00
<slot>
2024-09-27 13:49:40 +07:00
<q-fab-action
padding="xs"
color="primary"
icon="mdi-account-plus"
v-if="!hideIcon"
/>
2024-07-05 11:29:51 +07:00
</slot>
2024-06-13 14:55:49 +07:00
</q-fab>
2024-09-27 15:40:52 +07:00
<q-btn
v-else
fab
id="btn-add"
padding="sm"
icon="mdi-plus"
direction="up"
class="color-btn"
/>
2024-06-13 14:55:49 +07:00
</q-page-sticky>
</template>
2024-07-30 14:53:05 +07:00
<style scoped>
.color-btn {
color: white;
2024-07-30 17:15:01 +07:00
background: hsla(var(--blue-10-hsl) / 0.5);
transition: background 0.3s ease-in-out;
2024-07-30 14:53:05 +07:00
}
2024-07-30 17:15:01 +07:00
:deep(:where(.q-hoverable:hover, .q-fab--opened)) {
transition: background 0.3s ease-in-out;
2024-07-30 14:53:05 +07:00
background: hsla(var(--blue-10-hsl) / 1) !important;
}
</style>