fix(Field): can not disable error in form (#6382)

This commit is contained in:
neverland 2020-05-26 19:41:00 +08:00 committed by GitHub
parent 8db218e9c0
commit 126f2124a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,6 @@ export default createComponent({
...cellProps, ...cellProps,
name: String, name: String,
rules: Array, rules: Array,
error: Boolean,
disabled: Boolean, disabled: Boolean,
readonly: Boolean, readonly: Boolean,
autosize: [Boolean, Object], autosize: [Boolean, Object],
@ -58,6 +57,10 @@ export default createComponent({
type: String, type: String,
default: 'text', default: 'text',
}, },
error: {
type: Boolean,
default: null,
},
colon: { colon: {
type: Boolean, type: Boolean,
default: null, default: null,
@ -106,10 +109,12 @@ export default createComponent({
}, },
showError() { showError() {
if (this.error !== null) {
return this.error;
}
if (this.vanForm && this.vanForm.showError && this.validateMessage) { if (this.vanForm && this.vanForm.showError && this.validateMessage) {
return true; return true;
} }
return this.error;
}, },
listeners() { listeners() {