koel/resources/assets/js/components/layout/main-wrapper/sidebar/SidebarToggleButton.vue

24 lines
884 B
Vue
Raw Normal View History

2024-04-04 22:20:42 +00:00
<template>
<label
class="btn-toggle hidden md:flex w-[24px] aspect-square absolute rounded-full -right-[12px] top-[27px]
items-center justify-center z-10 text-k-text-secondary bg-k-bg-secondary border-[1.5px] border-white/20 cursor-pointer
hover:text-k-text-primary hover:bg-k-highlight"
2024-04-04 22:20:42 +00:00
>
2024-04-23 21:01:27 +00:00
<input v-model="value" class="hidden" type="checkbox">
<Icon :class="value || 'scale-x-[-1]'" :icon="faAngleLeft" class="transition" />
2024-04-04 22:20:42 +00:00
</label>
</template>
2024-04-23 21:01:27 +00:00
<script lang="ts" setup>
import { faAngleLeft } from '@fortawesome/free-solid-svg-icons'
2024-04-04 22:20:42 +00:00
import { computed } from 'vue'
const props = withDefaults(defineProps<{ modelValue?: boolean }>(), { modelValue: false })
const emit = defineEmits<{ (e: 'update:modelValue', value: boolean): void }>()
const value = computed({
get: () => props.modelValue,
set: value => emit('update:modelValue', value)
})
</script>