mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
25 lines
482 B
Vue
25 lines
482 B
Vue
<script setup lang="ts">
|
|
import type { GenericObject } from 'vee-validate'
|
|
import { useForm } from 'vee-validate'
|
|
|
|
const props = withDefaults(defineProps<{
|
|
initialValues?: GenericObject
|
|
keepValues?: boolean
|
|
}>(), {
|
|
initialValues: () => ({}),
|
|
keepValues: false
|
|
})
|
|
const form = useForm({
|
|
initialValues: props.initialValues,
|
|
keepValuesOnUnmount: props.keepValues
|
|
})
|
|
defineExpose({
|
|
form: form
|
|
})
|
|
|
|
|
|
</script>
|
|
<template>
|
|
<slot v-bind="form" />
|
|
</template>
|