mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
chore(tmagic-form-runtime): 销毁app
This commit is contained in:
parent
52f09f9f22
commit
8c9018407a
@ -23,7 +23,7 @@ export const useFormConfig = (props: AppProps) => {
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const formConfig = computed(() => props.fillConfig((config.value?.items || []) as FormConfig, mForm));
|
const formConfig = computed(() => props.fillConfig((config.value?.items || []) as FormConfig, mForm));
|
||||||
|
|
||||||
const app: Core | undefined = new Core({
|
let app: Core | undefined = new Core({
|
||||||
ua: contentWindow?.navigator.userAgent,
|
ua: contentWindow?.navigator.userAgent,
|
||||||
platform: 'editor',
|
platform: 'editor',
|
||||||
});
|
});
|
||||||
@ -137,6 +137,7 @@ export const useFormConfig = (props: AppProps) => {
|
|||||||
contentWindow?.addEventListener('message', runtimeReadyHandler);
|
contentWindow?.addEventListener('message', runtimeReadyHandler);
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
app = undefined;
|
||||||
contentWindow?.removeEventListener('message', runtimeReadyHandler);
|
contentWindow?.removeEventListener('message', runtimeReadyHandler);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user