From a7a536b8af5d53ecd97c7642f45cc4edc30b9721 Mon Sep 17 00:00:00 2001 From: byronogis Date: Wed, 4 Dec 2024 00:18:39 +0800 Subject: [PATCH] pref(packages/nuxt-layer-shared): reexport useSharedForm --- .../nuxt-layer-sakai/components/Sakai/Crud/SakaiCrud.vue | 1 - .../components/Sakai/Form/SakaiFormField.vue | 1 - .../components/Sakai/Form/SakaiFormFieldArray.vue | 2 -- packages/nuxt-layer-sakai/types/form.ts | 6 ------ packages/nuxt-layer-shared/composables/useSharedForm.ts | 3 +++ 5 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 packages/nuxt-layer-shared/composables/useSharedForm.ts diff --git a/packages/nuxt-layer-sakai/components/Sakai/Crud/SakaiCrud.vue b/packages/nuxt-layer-sakai/components/Sakai/Crud/SakaiCrud.vue index 143dee5..42865f0 100644 --- a/packages/nuxt-layer-sakai/components/Sakai/Crud/SakaiCrud.vue +++ b/packages/nuxt-layer-sakai/components/Sakai/Crud/SakaiCrud.vue @@ -9,7 +9,6 @@ import type { DataTablePageEvent, } from 'primevue/datatable' import { FilterMatchMode } from '@primevue/core/api' -import { useSharedForm } from '@project-starter/shared/composables' import SakaiForm from '../Form/SakaiForm.vue' defineOptions({ diff --git a/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormField.vue b/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormField.vue index 63d0a54..e595364 100644 --- a/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormField.vue +++ b/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormField.vue @@ -2,7 +2,6 @@ F extends SharedFormField " > -import type { SharedFormField } from '@project-starter/shared/composables' import SakaiUploader from '../SakaiUploader.vue' const props = defineProps<{ diff --git a/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormFieldArray.vue b/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormFieldArray.vue index fb1d964..0e3faa8 100644 --- a/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormFieldArray.vue +++ b/packages/nuxt-layer-sakai/components/Sakai/Form/SakaiFormFieldArray.vue @@ -2,8 +2,6 @@ F extends SharedFormField " > -import type { SharedFormField } from '@project-starter/shared/composables' - const props = defineProps<{ field: F }>() diff --git a/packages/nuxt-layer-sakai/types/form.ts b/packages/nuxt-layer-sakai/types/form.ts index d9d8311..2a73a9f 100644 --- a/packages/nuxt-layer-sakai/types/form.ts +++ b/packages/nuxt-layer-sakai/types/form.ts @@ -1,9 +1,3 @@ -import type { - SharedFormData, - SharedFormFields, - SharedFormGroup, - SharedFormGroups, -} from '@project-starter/shared/composables' import type { FilePondOptions, ProcessServerConfigFunction, diff --git a/packages/nuxt-layer-shared/composables/useSharedForm.ts b/packages/nuxt-layer-shared/composables/useSharedForm.ts new file mode 100644 index 0000000..ad73073 --- /dev/null +++ b/packages/nuxt-layer-shared/composables/useSharedForm.ts @@ -0,0 +1,3 @@ +// 从 shared 包重新导出以可被自动导入 +export * from '@project-starter/shared/composables/useSharedForm' +export * from '@project-starter/shared/types/form'