sadais-piui 1.2.7-beta25 → 1.2.7-beta26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -263,7 +263,7 @@ export default {
|
|
|
263
263
|
data() {
|
|
264
264
|
return {
|
|
265
265
|
initialValue: '', // 初始值
|
|
266
|
-
validateState: '', // 是否校验成功
|
|
266
|
+
validateState: 'success', // 是否校验成功
|
|
267
267
|
validateMessage: '' // 校验失败的提示语
|
|
268
268
|
}
|
|
269
269
|
},
|
|
@@ -400,7 +400,7 @@ export default {
|
|
|
400
400
|
// 从pi-form的rules属性中,取出当前pi-form-item的校验规则
|
|
401
401
|
getRules() {
|
|
402
402
|
// 父组件的所有规则
|
|
403
|
-
const parentRules = this._parent &&
|
|
403
|
+
const parentRules = this._parent && this._parent.validRules
|
|
404
404
|
const rules = parentRules ? parentRules[this.prop] : []
|
|
405
405
|
return [].concat(rules || [])
|
|
406
406
|
},
|
|
@@ -423,6 +423,9 @@ export default {
|
|
|
423
423
|
return new Promise((resolve, reject) => {
|
|
424
424
|
const rules = this.getFilteredRule(trigger)
|
|
425
425
|
if (!this.prop || !rules || rules.length === 0) {
|
|
426
|
+
this.validateState = 'success'
|
|
427
|
+
this.validateMessage = ''
|
|
428
|
+
console.log(TAG, '字段无需校验', this.prop)
|
|
426
429
|
return resolve(_getResolve())
|
|
427
430
|
}
|
|
428
431
|
const fieldValue = this._parent ? this._parent.model[this.prop] : undefined
|