computed: { formRules() { const rules = this.formConfig .filter(item => !this.isHidden(item) && item.require) .map(item => { return [item.fieldname, [{ required: !!item.require, message: `${item.labelText.replace(/:|:/g, "")}不能为空`, trigger: 'blur' }]] }) return Object.fromEntries(rules); }, fromData() { const fromData = this.formConfig.map(item => [item.fieldname, item.data]); return Object.fromEntries(fromData); } }, methods: { validate() { return new AsyncValidator(this.formRules).validate(this.fromData); }, }