vue3.0 antdesginVue 表单点击提交时校验表单
<a-form
ref="formRef"
:model="formState"
:rules="rules"
:label-col="{ span: 5 }"
:wrapper-col="{ span: 17 }"
>
</a-form>
const formRef = ref();
// 点击确定
async function submit() {
// 表单校验
const form = unref(formRef);
if (!form) return;
const valid = await form.validate();
if (!valid) return;
//这里写请求.....
}