mirror of
https://github.com/YunoHost/yunohost-portal.git
synced 2024-09-03 20:06:23 +02:00
rm BaseForm component
This commit is contained in:
parent
c5bb881d30
commit
a7ddfca923
1 changed files with 0 additions and 27 deletions
|
@ -1,27 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { useForm } from 'vee-validate'
|
|
||||||
import { toTypedSchema } from '@vee-validate/yup'
|
|
||||||
import * as yup from 'yup'
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
schema: yup.ObjectShape
|
|
||||||
initialValues: Record<string, any>
|
|
||||||
}>()
|
|
||||||
|
|
||||||
const emit = defineEmits(['submit'])
|
|
||||||
|
|
||||||
const { handleSubmit } = useForm({
|
|
||||||
validationSchema: toTypedSchema(yup.object(props.schema)),
|
|
||||||
initialValues: props.initialValues,
|
|
||||||
})
|
|
||||||
|
|
||||||
const onSubmit = handleSubmit((values) => {
|
|
||||||
emit('submit', values)
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<form novalidate @submit.prevent="onSubmit">
|
|
||||||
<slot name="default" />
|
|
||||||
</form>
|
|
||||||
</template>
|
|
Loading…
Add table
Reference in a new issue