feat: refs #7411 add VnCheckbox component with info support
This commit is contained in:
parent
01e726c6f7
commit
a337bdf474
|
@ -0,0 +1,40 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const $props = defineProps({
|
||||
modelValue: {
|
||||
type: [Boolean],
|
||||
default: null,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
info: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
const isChecked = computed({
|
||||
get: () => $props.modelValue,
|
||||
set: (value) => emit('update:modelValue', value),
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<QCheckbox
|
||||
:label="$props.label"
|
||||
v-model="isChecked"
|
||||
/>
|
||||
<QIcon v-if="$props.info" class="cursor-info q-ml-sm" name="info" size="sm">
|
||||
<QTooltip>
|
||||
{{ $props.info }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue