#7411 - addInfoOnVnCheckboxAndVnInput #1295
|
@ -0,0 +1,40 @@
|
||||||
|
<script setup>
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
|
const $props = defineProps({
|
||||||
|
modelValue: {
|
||||||
alexm marked this conversation as resolved
|
|||||||
|
type: [Boolean],
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
alexm
commented
Falta el Falta el
v-on="$attrs"
|
|||||||
|
},
|
||||||
|
});
|
||||||
alexm marked this conversation as resolved
Outdated
alexm
commented
Acabo de ver que falta esta parte para que tenga los mismo slots:
Acabo de ver que falta esta parte para que tenga los mismo slots:
```
<template v-for="(_, slotName) in $slots" #[slotName]="slotData" :key="slotName">
<slot :name="slotName" v-bind="slotData" :key="slotName" />
</template>
```
|
|||||||
|
|
||||||
alexm
commented
Quitar label y poner:
Para que tenga los mismo parametros y emita los mismos eventos Quitar label y poner:
```
v-bind="$attrs"
v-on="$attrs"
```
Para que tenga los mismo parametros y emita los mismos eventos
|
|||||||
|
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
no poner label