表单提交组件之间的校验

This commit is contained in:
熊丽君
2022-01-20 09:27:17 +08:00
parent eb90f0c1b6
commit 8be58b403d
7 changed files with 49 additions and 12 deletions

View File

@ -254,13 +254,14 @@ export default {
},
methods: {
submitForm() {
const flag = false;
let flag = false;
this.$refs["form"].validate((valid) => {
const cityForm = this.$refs.cityForm.submitForm();
const fieldForm = this.$refs.fieldForm.submitForm();
const keywordsForm = this.$refs.keywordsForm.submitForm();
const researchsForm = this.$refs.researchsForm.submitForm();
if (cityForm && fieldForm && keywordsForm && researchsForm) {
console.log(true);
flag = !flag;
}
});