[new feature] Field: add error-message prop (#492)
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
:type="type"
|
||||
:value="value"
|
||||
>
|
||||
<div
|
||||
v-if="errorMessage"
|
||||
v-text="errorMessage"
|
||||
class="van-field__error-message"
|
||||
/>
|
||||
<div
|
||||
v-if="hasIcon"
|
||||
v-show="$slots.icon || value"
|
||||
@@ -68,6 +73,7 @@ export default create({
|
||||
border: Boolean,
|
||||
required: Boolean,
|
||||
autosize: Boolean,
|
||||
errorMessage: String,
|
||||
onIconClick: {
|
||||
type: Function,
|
||||
default: () => {}
|
||||
|
||||
@@ -22,6 +22,12 @@
|
||||
padding-left: 90px;
|
||||
}
|
||||
|
||||
&__error-message {
|
||||
color: $red;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
&--has-textarea {
|
||||
.van-field__control {
|
||||
min-height: 60px;
|
||||
|
||||
Reference in New Issue
Block a user