11<script setup lang="ts">
22import * as v from ' valibot' ;
33import { convert , type PiResolvedCommonViewFieldConfig } from ' @piying/view-core' ;
4- import { computed , inject , markRaw , onUnmounted , provide , shallowRef , watch } from ' vue' ;
4+ import { computed , inject , provide , shallowRef , watch } from ' vue' ;
55import {
66 ChangeDetectionScheduler ,
77 ChangeDetectionSchedulerImpl ,
@@ -30,8 +30,8 @@ const inputs = defineProps<{
3030
3131const emit = defineEmits ([' update:modelValue' ]);
3232const maybeParentField = inject (PI_VIEW_FIELD_TOKEN , undefined );
33- const rootInjector = computed (() => {
34- return (
33+ const rootInjector = computed (
34+ () =>
3535 inputs .options .injector ??
3636 maybeParentField ?.value .injector ??
3737 createRootInjector ({
@@ -41,9 +41,8 @@ const rootInjector = computed(() => {
4141 useClass: ChangeDetectionSchedulerImpl ,
4242 },
4343 ],
44- })
45- );
46- });
44+ }),
45+ );
4746provide (InjectorToken , rootInjector );
4847provide (
4948 PI_INPUT_OPTIONS_TOKEN ,
@@ -58,7 +57,7 @@ provide(
5857 computed (() => inputs .modelValue ),
5958);
6059
61- let initResult =
60+ const initResult =
6261 shallowRef <[Omit <PiResolvedCommonViewFieldConfig <any , any >, ' define' >, R3Injector ]>();
6362watch (
6463 () => [inputs .schema , inputs .options , rootInjector .value ],
0 commit comments