This commit is contained in:
dap
2024-11-05 07:53:13 +08:00
48 changed files with 107 additions and 80 deletions

View File

@@ -52,7 +52,7 @@ const emit = defineEmits<{
const router = useRouter();
const [Form, { validate, setFieldValue, getValues }] = useVbenForm(
const [Form, formApi] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -64,8 +64,8 @@ const [Form, { validate, setFieldValue, getValues }] = useVbenForm(
);
async function handleSubmit() {
const { valid } = await validate();
const values = await getValues();
const { valid } = await formApi.validate();
const values = await formApi.getValues();
if (valid) {
emit('submit', {
tenantId: values?.tenantId,
@@ -79,7 +79,9 @@ function goToLogin() {
router.push(props.loginPath);
}
defineExpose({ setFieldValue });
defineExpose({
getFormApi: () => formApi,
});
</script>
<template>