From 0ef3a0553da6246467f8d0f5e846cab4f60bd8db Mon Sep 17 00:00:00 2001 From: Zz-ZzzZ <1136261471@qq.com> Date: Tue, 7 Nov 2023 11:09:22 +0800 Subject: [PATCH] feat(Loading): hide loading will remove app instance when use plugin or directive call --- src/loading/plugin.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/loading/plugin.tsx b/src/loading/plugin.tsx index ed44e1a6a2..71d753fc1c 100644 --- a/src/loading/plugin.tsx +++ b/src/loading/plugin.tsx @@ -23,7 +23,8 @@ function createLoading(props: TdLoadingProps): LoadingInstance { const attach = getAttach(props.attach); - const loading = createApp(component).mount(document.createElement('div')); + const app = createApp(component); + const loading = app.mount(document.createElement('div')); const parentRelativeClass = usePrefixClass('loading__parent--relative').value; const prefixClass = usePrefixClass('loading'); @@ -40,6 +41,7 @@ function createLoading(props: TdLoadingProps): LoadingInstance { item.remove(); }); removeClass(attach, parentRelativeClass); + app.unmount(); }, }; return loadingInstance;