2022-09-12 22:47:27 +00:00
|
|
|
<template>
|
|
|
|
<div v-if="!inline" class="form-control w-full">
|
|
|
|
<label class="label cursor-pointer">
|
|
|
|
<span class="label-text"> {{ label }}</span>
|
2022-11-01 07:30:42 +00:00
|
|
|
<input v-model="value" type="checkbox" class="checkbox checkbox-primary" />
|
2022-09-12 22:47:27 +00:00
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div v-else class="label cursor-pointer sm:grid sm:grid-cols-4 sm:items-start sm:gap-4">
|
|
|
|
<label>
|
|
|
|
<span class="label-text">
|
|
|
|
{{ label }}
|
|
|
|
</span>
|
|
|
|
</label>
|
2022-11-01 07:30:42 +00:00
|
|
|
<input v-model="value" type="checkbox" class="checkbox checkbox-primary" />
|
2022-09-12 22:47:27 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
const props = defineProps({
|
|
|
|
modelValue: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
inline: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
label: {
|
|
|
|
type: String,
|
|
|
|
default: "",
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const value = useVModel(props, "modelValue");
|
|
|
|
</script>
|