fix: typo for injection key
This commit is contained in:
parent
137ecb8d01
commit
f1b9817f93
|
|
@ -1,7 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { type InjectionKey } from 'vue'
|
import { type InjectionKey } from 'vue'
|
||||||
|
|
||||||
export const FORMI_TEM_INJECTION_KEY
|
export const FORM_ITEM_INJECTION_KEY
|
||||||
= Symbol() as InjectionKey<string>
|
= Symbol() as InjectionKey<string>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ defineOptions({
|
||||||
})
|
})
|
||||||
|
|
||||||
const id = useId()
|
const id = useId()
|
||||||
provide(FORMI_TEM_INJECTION_KEY, id)
|
provide(FORM_ITEM_INJECTION_KEY, id)
|
||||||
|
|
||||||
const { class: className, ...rest } = useAttrs()
|
const { class: className, ...rest } = useAttrs()
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
|
import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
|
||||||
import { inject } from 'vue'
|
import { inject } from 'vue'
|
||||||
import { FORMI_TEM_INJECTION_KEY } from './FormItem.vue'
|
import { FORM_ITEM_INJECTION_KEY } from './FormItem.vue'
|
||||||
|
|
||||||
export function useFormField() {
|
export function useFormField() {
|
||||||
const fieldContext = inject(FieldContextKey)
|
const fieldContext = inject(FieldContextKey)
|
||||||
const fieldItemContext = inject(FORMI_TEM_INJECTION_KEY)
|
const fieldItemContext = inject(FORM_ITEM_INJECTION_KEY)
|
||||||
|
|
||||||
const fieldState = {
|
const fieldState = {
|
||||||
valid: useIsFieldValid(),
|
valid: useIsFieldValid(),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { type InjectionKey } from 'vue'
|
import { type InjectionKey } from 'vue'
|
||||||
|
|
||||||
export const FORMI_TEM_INJECTION_KEY
|
export const FORM_ITEM_INJECTION_KEY
|
||||||
= Symbol() as InjectionKey<string>
|
= Symbol() as InjectionKey<string>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@ import { useId } from 'radix-vue'
|
||||||
import { cn } from '@/lib/utils'
|
import { cn } from '@/lib/utils'
|
||||||
|
|
||||||
const id = useId()
|
const id = useId()
|
||||||
provide(FORMI_TEM_INJECTION_KEY, id)
|
provide(FORM_ITEM_INJECTION_KEY, id)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
|
import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
|
||||||
import { inject } from 'vue'
|
import { inject } from 'vue'
|
||||||
import { FORMI_TEM_INJECTION_KEY } from './FormItem.vue'
|
import { FORM_ITEM_INJECTION_KEY } from './FormItem.vue'
|
||||||
|
|
||||||
export function useFormField() {
|
export function useFormField() {
|
||||||
const fieldContext = inject(FieldContextKey)
|
const fieldContext = inject(FieldContextKey)
|
||||||
const fieldItemContext = inject(FORMI_TEM_INJECTION_KEY)
|
const fieldItemContext = inject(FORM_ITEM_INJECTION_KEY)
|
||||||
|
|
||||||
const fieldState = {
|
const fieldState = {
|
||||||
valid: useIsFieldValid(),
|
valid: useIsFieldValid(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user