feat(Checkbox/Radio/RadioGroup): add help slot

Resolves #1957
This commit is contained in:
Benjamin Canac
2024-07-23 16:16:51 +02:00
parent b264ad2ebd
commit c3122f776d
5 changed files with 22 additions and 6 deletions

View File

@@ -87,6 +87,10 @@ slots:
[Label]{.italic}
::
### `help` :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"}
Like the `#label` slot, use the `#help` slot to override the content of the help text.
## Props
:component-props

View File

@@ -126,6 +126,10 @@ slots:
[Label]{.italic}
::
### `help` :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"}
Like the `#label` slot, use the `#help` slot to override the content of the help text.
### `legend`
Use the `#legend` slot to override the content of the legend.

View File

@@ -17,11 +17,13 @@
</div>
<div v-if="label || $slots.label" :class="ui.inner">
<label :for="inputId" :class="ui.label">
<slot name="label">{{ label }}</slot>
<slot name="label" :label="label">{{ label }}</slot>
<span v-if="required" :class="ui.required">*</span>
</label>
<p v-if="help" :class="ui.help">
{{ help }}
<p v-if="help || $slots.help" :class="ui.help">
<slot name="help" :help="help">
{{ help }}
</slot>
</p>
</div>
</div>

View File

@@ -16,11 +16,13 @@
</div>
<div v-if="label || $slots.label" :class="ui.inner">
<label :for="inputId" :class="ui.label">
<slot name="label">{{ label }}</slot>
<slot name="label" :label="label">{{ label }}</slot>
<span v-if="required" :class="ui.required">*</span>
</label>
<p v-if="help" :class="ui.help">
{{ help }}
<p v-if="help || $slots.help" :class="ui.help">
<slot name="help" :help="help">
{{ help }}
</slot>
</p>
</div>
</div>

View File

@@ -20,6 +20,10 @@
<template #label>
<slot name="label" v-bind="{ option, selected: option.selected }" />
</template>
<template #help>
<slot name="help" v-bind="{ option, selected: option.selected }" />
</template>
</URadio>
</fieldset>
</div>