koel/resources/assets/js/components/ui/ScreenControlsToggle.vue

35 lines
853 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<label v-if="isMobile.phone" class="text-highlight">
2022-12-02 16:17:37 +00:00
<input v-model="value" type="checkbox">
2023-11-10 13:16:06 +00:00
<Icon :icon="value ? faCaretUp : faCaretDown" class="toggle" />
<span>Toggle the song list controls</span>
</label>
2022-04-15 14:24:30 +00:00
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
2022-10-25 18:25:58 +00:00
import { faCaretDown, faCaretUp } from '@fortawesome/free-solid-svg-icons'
2022-04-15 14:24:30 +00:00
import isMobile from 'ismobilejs'
import { computed } from 'vue'
2022-04-15 14:24:30 +00:00
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)
})
2022-04-15 14:24:30 +00:00
</script>
2024-04-04 20:13:35 +00:00
<style lang="postcss" scoped>
label {
2022-04-15 14:24:30 +00:00
font-size: 1rem;
display: inline-block;
2022-04-15 14:24:30 +00:00
margin-left: 4px;
}
input, span {
display: none;
}
2022-04-15 14:24:30 +00:00
</style>