mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(Field): can not disable error in form (#6382)
This commit is contained in:
parent
8db218e9c0
commit
126f2124a2
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user