支持系统菜单功能

This commit is contained in:
muwoo
2021-12-10 16:47:33 +08:00
parent c9d6b04a7d
commit 6ee0b2a795
8 changed files with 99 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ const createPluginManager = (): any => {
plugins: [],
localPlugins: [],
currentPlugin: {},
pluginLoading: false,
});
const appList = ref([]);
@@ -28,6 +29,10 @@ const createPluginManager = (): any => {
const openPlugin = (plugin) => {
if (plugin.pluginType === "ui") {
if (state.currentPlugin && state.currentPlugin.name === plugin.name) {
return;
}
state.pluginLoading = true;
state.currentPlugin = plugin;
ipcRenderer.sendSync("msg-trigger", {
type: "openPlugin",
@@ -84,7 +89,6 @@ const createPluginManager = (): any => {
};
window.setCurrentPlugin = ({ currentPlugin }) => {
console.log(currentPlugin);
state.currentPlugin = currentPlugin;
setSearchValue("");
};
@@ -95,6 +99,10 @@ const createPluginManager = (): any => {
window.setSubInput({ placeholder: "" });
};
window.pluginLoaded = () => {
state.pluginLoading = false;
};
return {
...toRefs(state),
initPlugins,