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

25 lines
903 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-bg-secondary"
>
2024-04-23 21:01:27 +00:00
<input v-model="value" class="hidden" type="checkbox">
2024-04-04 22:20:42 +00:00
<Icon v-if="value" :icon="faAngleLeft" />
<Icon v-else :icon="faAngleRight" />
</label>
</template>
2024-04-23 21:01:27 +00:00
<script lang="ts" setup>
2024-04-04 22:20:42 +00:00
import { faAngleLeft, faAngleRight } from '@fortawesome/free-solid-svg-icons'
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>