perf: adjustment of form spelling errors, type adjustment, closer to actual development (#4694)

This commit is contained in:
Vben
2024-10-20 21:44:25 +08:00
committed by GitHub
parent 646598afba
commit 860fc15ce6
32 changed files with 95 additions and 122 deletions

View File

@@ -1,8 +1,7 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import type { VbenFormSchema } from '@vben-core/form-ui';
import type { RegisterEmits } from './types';
import { computed, reactive } from 'vue';
import { useRouter } from 'vue-router';
@@ -19,7 +18,7 @@ interface Props {
*/
loading?: boolean;
/**
* @zh_CN 登路径
* @zh_CN 登路径
*/
loginPath?: string;
/**
@@ -50,10 +49,10 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits<{
submit: RegisterEmits['submit'];
submit: [Recordable<any>];
}>();
const [Form, { validate }] = useVbenForm(
const [Form, { validate, getValues }] = useVbenForm(
reactive({
commonConfig: {
hideLabel: true,
@@ -67,7 +66,8 @@ const [Form, { validate }] = useVbenForm(
const router = useRouter();
async function handleSubmit() {
const { valid, values } = await validate();
const { valid } = await validate();
const values = await getValues();
if (valid) {
emit('submit', values as { password: string; username: string });
}