feat(Form): add show-error prop (#5941)
This commit is contained in:
+8
-1
@@ -101,6 +101,13 @@ export default createComponent({
|
||||
);
|
||||
},
|
||||
|
||||
showError() {
|
||||
if (this.vanForm && this.vanForm.showError && this.validateMessage) {
|
||||
return true;
|
||||
}
|
||||
return this.error;
|
||||
},
|
||||
|
||||
listeners() {
|
||||
const listeners = {
|
||||
...this.$listeners,
|
||||
@@ -540,7 +547,7 @@ export default createComponent({
|
||||
scopedSlots={scopedSlots}
|
||||
arrowDirection={this.arrowDirection}
|
||||
class={bem({
|
||||
error: this.error || this.validateMessage,
|
||||
error: this.showError,
|
||||
[`label-${labelAlign}`]: labelAlign,
|
||||
'min-height': this.type === 'textarea' && !this.autosize,
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user