Vanessa 2024-01-20 23:01:41 +08:00
parent db690c51b6
commit 09e5828ffe
4 changed files with 22 additions and 11 deletions

View file

@ -7,6 +7,7 @@ import {resizeTopBar, saveLayout} from "../layout/util";
import {API} from "./API";
import {getFrontend, isMobile, isWindow} from "../util/functions";
import {Constants} from "../constants";
import {uninstall} from "./uninstall";
const requireFunc = (key: string) => {
const modules = {
@ -231,3 +232,14 @@ export const afterLoadPlugin = (plugin: Plugin) => {
saveLayout();
/// #endif
};
export const reloadPlugin = (app: App) => {
app.plugins.forEach((item) => {
uninstall(this, item.name);
});
loadPlugins(this).then(() => {
app.plugins.forEach(item => {
afterLoadPlugin(item);
});
});
};