解决input字段组件的校验提示不会自动清除的问题。
parent
4ccff6e219
commit
3b49bc5fb7
|
@ -27,7 +27,7 @@ export default {
|
|||
//--------------------- 组件内部方法 begin ------------------//
|
||||
|
||||
initFieldModel() {
|
||||
if (this.field.formItemFlag === false) {
|
||||
if (!this.field.formItemFlag) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -175,10 +175,18 @@ export default {
|
|||
},
|
||||
|
||||
clearFieldRules() {
|
||||
if (!this.field.formItemFlag) {
|
||||
return
|
||||
}
|
||||
|
||||
this.rules.splice(0, this.rules.length) //清空已有
|
||||
},
|
||||
|
||||
buildFieldRules() {
|
||||
if (!this.field.formItemFlag) {
|
||||
return
|
||||
}
|
||||
|
||||
this.rules.splice(0, this.rules.length) //清空已有
|
||||
if (!!this.field.options.required) {
|
||||
this.rules.push({
|
||||
|
@ -326,6 +334,9 @@ export default {
|
|||
handleInputCustomEvent(value) {
|
||||
this.syncUpdateFormModel(value)
|
||||
|
||||
/* 主动触发表单的单个字段校验,用于清除字段可能存在的校验错误提示 */
|
||||
this.dispatch('VFormRender', 'fieldValidation', [this.field.options.name])
|
||||
|
||||
if (!!this.field.options.onInput) {
|
||||
let customFn = new Function('value', this.field.options.onInput)
|
||||
customFn.call(this, value)
|
||||
|
@ -529,6 +540,14 @@ export default {
|
|||
this.customToolbar = customToolbar
|
||||
},
|
||||
|
||||
/**
|
||||
* 是否子表单内嵌的组件
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isSubFormItem() {
|
||||
return !!this.parentWidget ? this.parentWidget.type === 'sub-form' : false
|
||||
}
|
||||
|
||||
//--------------------- 以上为组件支持外部调用的API方法 end ------------------//
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
export default {
|
||||
name: "container-item-wrapper",
|
||||
props: {
|
||||
widget: Object,
|
||||
widget: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
customClass() {
|
||||
|
|
Loading…
Reference in New Issue