FreeTube/src/renderer/components/ft-toggle-switch/ft-toggle-switch.vue

38 lines
752 B
Vue
Raw Normal View History

2020-02-21 21:40:46 +01:00
<template>
2020-09-07 03:19:08 +02:00
<div
class="switch-ctn"
:class="{
compact,
disabled: disabled
}"
2020-09-07 03:19:08 +02:00
>
2020-02-21 21:40:46 +01:00
<input
:id="id"
2020-06-19 22:20:06 +02:00
v-model="currentValue"
type="checkbox"
2020-02-21 21:40:46 +01:00
name="set-name"
class="switch-input"
2020-06-19 22:20:06 +02:00
:checked="currentValue"
:disabled="disabled"
2020-02-21 21:40:46 +01:00
@change="$emit('change', currentValue)"
>
<label
:for="id"
2020-04-12 05:51:29 +02:00
class="switch-label"
2020-02-21 21:40:46 +01:00
>
<span class="switch-label-text">
{{ label }}
</span>
<ft-tooltip
v-if="tooltip !== ''"
class="selectTooltip"
position="bottom-left"
:tooltip="tooltip"
/>
2020-02-21 21:40:46 +01:00
</label>
</div>
</template>
<script src="./ft-toggle-switch.js" />
2020-03-27 12:37:54 +01:00
<style scoped lang="sass" src="./ft-toggle-switch.sass" />