♻️ refactor: component updated
This commit is contained in:
parent
dc288d42bb
commit
625189077b
|
@ -14,6 +14,7 @@ const props = withDefaults(defineProps<IVLabel>(), {
|
||||||
<template>
|
<template>
|
||||||
<label
|
<label
|
||||||
:for="props.for"
|
:for="props.for"
|
||||||
|
class="label-container"
|
||||||
:class="[styles['text-body-MD-standard-text-Regular'], {
|
:class="[styles['text-body-MD-standard-text-Regular'], {
|
||||||
'label': props.type === 'default',
|
'label': props.type === 'default',
|
||||||
'success': props.type === 'success',
|
'success': props.type === 'success',
|
||||||
|
@ -23,12 +24,14 @@ const props = withDefaults(defineProps<IVLabel>(), {
|
||||||
:aria-label="props.label"
|
:aria-label="props.label"
|
||||||
:aria-disabled="props.disabled"
|
:aria-disabled="props.disabled"
|
||||||
>
|
>
|
||||||
|
<span>
|
||||||
{{ props.label }}
|
{{ props.label }}
|
||||||
<template v-if="props.required">
|
<template v-if="props.required">
|
||||||
<span v-if="props.required" :class="{ 'required': !props.disabled}">
|
<span v-if="props.required" :class="{ 'required': !props.disabled}">
|
||||||
<slot name="required-tip">*</slot>
|
<slot name="required-tip">*</slot>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
</span>
|
||||||
<VHint
|
<VHint
|
||||||
v-if="props.hint"
|
v-if="props.hint"
|
||||||
:title="props.hint"
|
:title="props.hint"
|
||||||
|
@ -38,6 +41,18 @@ const props = withDefaults(defineProps<IVLabel>(), {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
|
*{
|
||||||
|
padding: 0px;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label-container{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: start;
|
||||||
|
gap: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
.label {color: var(--text-label-grey);}
|
.label {color: var(--text-label-grey);}
|
||||||
.success {color: var(--text-default-success);}
|
.success {color: var(--text-default-success);}
|
||||||
.error {color: var(--text-default-error);}
|
.error {color: var(--text-default-error);}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user