[new feature] Field: add error-message prop (#492)

This commit is contained in:
neverland
2017-12-29 14:48:19 +08:00
committed by GitHub
parent d79cf0c1ed
commit ef01dd5321
5 changed files with 62 additions and 7 deletions
+6
View File
@@ -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: () => {}
+6
View File
@@ -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;