mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Field): required mark position (#9035)
This commit is contained in:
parent
ad3275ba7a
commit
69524def7b
@ -567,11 +567,13 @@ export default defineComponent({
|
|||||||
center={props.center}
|
center={props.center}
|
||||||
border={props.border}
|
border={props.border}
|
||||||
isLink={props.isLink}
|
isLink={props.isLink}
|
||||||
required={props.required}
|
|
||||||
clickable={props.clickable}
|
clickable={props.clickable}
|
||||||
titleStyle={labelStyle.value}
|
titleStyle={labelStyle.value}
|
||||||
valueClass={bem('value')}
|
valueClass={bem('value')}
|
||||||
titleClass={[bem('label', labelAlign), props.labelClass]}
|
titleClass={[
|
||||||
|
bem('label', [labelAlign, { required: props.required }]),
|
||||||
|
props.labelClass,
|
||||||
|
]}
|
||||||
arrowDirection={props.arrowDirection}
|
arrowDirection={props.arrowDirection}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -344,3 +344,4 @@ The component provides the following CSS variables, which can be used to customi
|
|||||||
| --van-field-word-limit-font-size | _var(--van-font-size-sm)_ | - |
|
| --van-field-word-limit-font-size | _var(--van-font-size-sm)_ | - |
|
||||||
| --van-field-word-limit-line-height | _16px_ | - |
|
| --van-field-word-limit-line-height | _16px_ | - |
|
||||||
| --van-field-disabled-text-color | _var(--van-gray-5)_ | - |
|
| --van-field-disabled-text-color | _var(--van-gray-5)_ | - |
|
||||||
|
| --van-field-required-mark-color | _var(--van-red)_ | - |
|
||||||
|
@ -363,6 +363,7 @@ export default {
|
|||||||
| --van-field-word-limit-font-size | _var(--van-font-size-sm)_ | - |
|
| --van-field-word-limit-font-size | _var(--van-font-size-sm)_ | - |
|
||||||
| --van-field-word-limit-line-height | _16px_ | - |
|
| --van-field-word-limit-line-height | _16px_ | - |
|
||||||
| --van-field-disabled-text-color | _var(--van-gray-5)_ | - |
|
| --van-field-disabled-text-color | _var(--van-gray-5)_ | - |
|
||||||
|
| --van-field-required-mark-color | _var(--van-red)_ | - |
|
||||||
|
|
||||||
## 常见问题
|
## 常见问题
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
--van-field-word-limit-font-size: @field-word-limit-font-size;
|
--van-field-word-limit-font-size: @field-word-limit-font-size;
|
||||||
--van-field-word-limit-line-height: @field-word-limit-line-height;
|
--van-field-word-limit-line-height: @field-word-limit-line-height;
|
||||||
--van-field-disabled-text-color: @field-disabled-text-color;
|
--van-field-disabled-text-color: @field-disabled-text-color;
|
||||||
|
--van-field-required-mark-color: @field-required-mark-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-field {
|
.van-field {
|
||||||
@ -39,6 +40,14 @@
|
|||||||
&--right {
|
&--right {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--required {
|
||||||
|
&::before {
|
||||||
|
margin-right: 2px;
|
||||||
|
color: var(--van-field-required-mark-color);
|
||||||
|
content: '*';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&--disabled {
|
&--disabled {
|
||||||
|
@ -183,8 +183,8 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="van-cell-group van-cell-group--inset">
|
<div class="van-cell-group van-cell-group--inset">
|
||||||
<div class="van-cell van-cell--required van-field van-field--error">
|
<div class="van-cell van-field van-field--error">
|
||||||
<div class="van-cell__title van-field__label">
|
<div class="van-cell__title van-field__label van-field__label--required">
|
||||||
<span>
|
<span>
|
||||||
Username
|
Username
|
||||||
</span>
|
</span>
|
||||||
@ -198,8 +198,8 @@ exports[`should render demo and match snapshot 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="van-cell van-cell--required van-field">
|
<div class="van-cell van-field">
|
||||||
<div class="van-cell__title van-field__label">
|
<div class="van-cell__title van-field__label van-field__label--required">
|
||||||
<span>
|
<span>
|
||||||
Phone
|
Phone
|
||||||
</span>
|
</span>
|
||||||
|
@ -18,3 +18,4 @@
|
|||||||
@field-word-limit-font-size: var(--van-font-size-sm);
|
@field-word-limit-font-size: var(--van-font-size-sm);
|
||||||
@field-word-limit-line-height: 16px;
|
@field-word-limit-line-height: 16px;
|
||||||
@field-disabled-text-color: var(--van-gray-5);
|
@field-disabled-text-color: var(--van-gray-5);
|
||||||
|
@field-required-mark-color: var(--van-red);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user