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

35 lines
850 B
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<label v-if="isMobile.phone" class="text-highlight">
<input type="checkbox" v-model="value"/>
2022-10-25 18:25:58 +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>
<style lang="scss" 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>