feat(Form): new component (#439)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2023-07-31 15:22:14 +02:00
committed by GitHub
parent c37a927b4e
commit a3aba1abad
22 changed files with 945 additions and 17 deletions

View File

@@ -0,0 +1,18 @@
import { inject } from 'vue'
import { UseEventBusReturn } from '@vueuse/core'
import { FormEvent } from '../types'
export const useFormEvents = () => {
const formBus = inject<UseEventBusReturn<FormEvent, string> | undefined>('form-events', undefined)
const formPath = inject<string | undefined>('form-path', undefined)
const emitFormBlur = () => {
if (formBus && formPath) {
formBus.emit({ type: 'blur', path: formPath })
}
}
return {
emitFormBlur
}
}