♻️ refactor: required-tip slot improved

This commit is contained in:
Paul Valerie GOMA 2025-07-23 09:53:34 +02:00
parent 5c89228564
commit 8b138d905e

View File

@ -24,12 +24,11 @@ const props = withDefaults(defineProps<IVLabel>(), {
:aria-disabled="props.disabled" :aria-disabled="props.disabled"
> >
{{ props.label }} {{ props.label }}
<slot name="required-type"> <template v-if="props.required">
<span <span v-if="props.required" :class="{ 'required': !props.disabled}">
v-if="props.required" <slot name="required-tip">*</slot>
:class="{ 'required': props.required }" </span>
>*</span> </template>
</slot>
<VHint <VHint
v-if="props.hint" v-if="props.hint"
:title="props.hint" :title="props.hint"
@ -43,5 +42,8 @@ const props = withDefaults(defineProps<IVLabel>(), {
.success {color: var(--text-default-success);} .success {color: var(--text-default-success);}
.error {color: var(--text-default-error);} .error {color: var(--text-default-error);}
.disabled {color: var(--text-disabled-grey);} .disabled {color: var(--text-disabled-grey);}
.required {color: var(--minor-red-marianne);} .required {
color: var(--minor-red-marianne);
display: inline;
}
</style> </style>