mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
31 lines
711 B
Vue
31 lines
711 B
Vue
<script setup lang="ts">
|
|
import type { CheckboxItemProps, BaseItemComputedProps } from '@/types/form'
|
|
|
|
withDefaults(defineProps<CheckboxItemProps & BaseItemComputedProps>(), {
|
|
id: undefined,
|
|
name: undefined,
|
|
placeholder: undefined,
|
|
touchKey: undefined,
|
|
label: undefined,
|
|
labels: () => ({ true: 'yes', false: 'no' }),
|
|
|
|
ariaDescribedby: undefined,
|
|
state: undefined,
|
|
validation: undefined,
|
|
})
|
|
|
|
const modelValue = defineModel<boolean>()
|
|
</script>
|
|
|
|
<template>
|
|
<BFormCheckbox
|
|
:id="id"
|
|
v-model="modelValue"
|
|
:name="name"
|
|
:aria-describedby="ariaDescribedby"
|
|
:state="state"
|
|
switch
|
|
>
|
|
{{ label || $t(labels[modelValue ? 'true' : 'false']) }}
|
|
</BFormCheckbox>
|
|
</template>
|