refactor: move InjectionKey export from FormItem.vue to .ts file to avoid warnings
Fixes #176
This commit is contained in:
parent
cbb40522dc
commit
7cc073ecc3
|
|
@ -1,10 +1,3 @@
|
|||
<script lang="ts">
|
||||
import { type InjectionKey } from 'vue'
|
||||
|
||||
export const FORM_ITEM_INJECTION_KEY
|
||||
= Symbol() as InjectionKey<string>
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { provide, useAttrs } from 'vue'
|
||||
import { useId } from 'radix-vue'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
import { type InjectionKey } from 'vue'
|
||||
|
||||
export const FORM_ITEM_INJECTION_KEY
|
||||
= Symbol() as InjectionKey<string>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
|
||||
import { inject } from 'vue'
|
||||
import { FORM_ITEM_INJECTION_KEY } from './FormItem.vue'
|
||||
import { FORM_ITEM_INJECTION_KEY } from './InjectionKey'
|
||||
|
||||
export function useFormField() {
|
||||
const fieldContext = inject(FieldContextKey)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<script lang="ts">
|
||||
import { type InjectionKey } from 'vue'
|
||||
|
||||
export const FORM_ITEM_INJECTION_KEY
|
||||
= Symbol() as InjectionKey<string>
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { provide } from 'vue'
|
||||
import { useId } from 'radix-vue'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
import { type InjectionKey } from 'vue'
|
||||
|
||||
export const FORM_ITEM_INJECTION_KEY
|
||||
= Symbol() as InjectionKey<string>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { FieldContextKey, useFieldError, useIsFieldDirty, useIsFieldTouched, useIsFieldValid } from 'vee-validate'
|
||||
import { inject } from 'vue'
|
||||
import { FORM_ITEM_INJECTION_KEY } from './FormItem.vue'
|
||||
import { FORM_ITEM_INJECTION_KEY } from './InjectionKey'
|
||||
|
||||
export function useFormField() {
|
||||
const fieldContext = inject(FieldContextKey)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user