Skip to content

Commit

Permalink
feat(Loading): hide loading will remove app instance when use plugin …
Browse files Browse the repository at this point in the history
…or directive call
  • Loading branch information
Zz-ZzzZ committed Nov 7, 2023
1 parent e23d7ec commit 0ef3a05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/loading/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -40,6 +41,7 @@ function createLoading(props: TdLoadingProps): LoadingInstance {
item.remove();
});
removeClass(attach, parentRelativeClass);
app.unmount();
},
};
return loadingInstance;
Expand Down

0 comments on commit 0ef3a05

Please sign in to comment.