Enhance CheckboxInput and ToggleSwitchInput Components with Help Slot Positioning (#728)
- Introduce conditional rendering for help text in CheckboxInput.vue and ToggleSwitchInput.vue, allowing help text to be displayed either above or below the input based on the helpPosition prop. - Update the structure of the help slot to improve flexibility and user experience. These changes enhance the usability of the form components by providing clearer guidance to users.
This commit is contained in:
parent
37a10cbdfa
commit
eb493c357c
|
|
@ -15,6 +15,19 @@
|
|||
:theme="theme"
|
||||
/>
|
||||
<div>
|
||||
<slot
|
||||
v-if="helpPosition === 'above_input'"
|
||||
name="help"
|
||||
>
|
||||
<InputHelp
|
||||
:help="help"
|
||||
:help-classes="theme.default.help"
|
||||
>
|
||||
<template #after-help>
|
||||
<slot name="bottom_after_help" />
|
||||
</template>
|
||||
</InputHelp>
|
||||
</slot>
|
||||
<slot name="label">
|
||||
<label
|
||||
:aria-label="id ? id : name"
|
||||
|
|
@ -28,7 +41,10 @@
|
|||
>*</span>
|
||||
</label>
|
||||
</slot>
|
||||
<slot name="help">
|
||||
<slot
|
||||
v-if="helpPosition === 'below_input'"
|
||||
name="help"
|
||||
>
|
||||
<InputHelp
|
||||
:help="help"
|
||||
:help-classes="theme.default.help"
|
||||
|
|
|
|||
|
|
@ -16,6 +16,19 @@
|
|||
/>
|
||||
|
||||
<div>
|
||||
<slot
|
||||
v-if="helpPosition === 'above_input'"
|
||||
name="help"
|
||||
>
|
||||
<InputHelp
|
||||
:help="help"
|
||||
:help-classes="theme.default.help"
|
||||
>
|
||||
<template #after-help>
|
||||
<slot name="bottom_after_help" />
|
||||
</template>
|
||||
</InputHelp>
|
||||
</slot>
|
||||
<slot name="label">
|
||||
<label
|
||||
:aria-label="id ? id : name"
|
||||
|
|
@ -29,7 +42,10 @@
|
|||
>*</span>
|
||||
</label>
|
||||
</slot>
|
||||
<slot name="help">
|
||||
<slot
|
||||
v-if="helpPosition === 'below_input'"
|
||||
name="help"
|
||||
>
|
||||
<InputHelp
|
||||
:help="help"
|
||||
:help-classes="theme.default.help"
|
||||
|
|
|
|||
Loading…
Reference in New Issue