mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-06-05 01:32:10 +08:00
fix(editor): 显式标注 CompareForm 的 defineExpose 类型以修复 DTS 构建报错
defineExpose 同时暴露 MForm 实例 ref 与递归的 FormConfig ref,导致 vue-tsc 生成声明文件时推断类型过大无法序列化(TS7056)。改为显式标注 暴露类型,使其引用具名别名而非展开完整结构。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
025cca365c
commit
7a61a35664
@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, ref, useTemplateRef, watch, watchEffect } from 'vue';
|
import { computed, inject, type Ref, ref, type ShallowRef, useTemplateRef, watch, watchEffect } from 'vue';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
|
|
||||||
import { type CodeBlockContent, type DataSourceSchema, HookType, type MNode } from '@tmagic/core';
|
import { type CodeBlockContent, type DataSourceSchema, HookType, type MNode } from '@tmagic/core';
|
||||||
@ -213,7 +213,11 @@ watchEffect(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose<{
|
||||||
|
form: ShallowRef<InstanceType<typeof MForm> | null>;
|
||||||
|
config: Ref<FormConfig>;
|
||||||
|
reload: () => Promise<void>;
|
||||||
|
}>({
|
||||||
form: formRef,
|
form: formRef,
|
||||||
config,
|
config,
|
||||||
reload: loadConfig,
|
reload: loadConfig,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user