♻️ search 框输入交互优化

This commit is contained in:
muwoo
2021-12-08 15:51:54 +08:00
parent 951f21f5fa
commit 8a35e60e48
17 changed files with 253 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ import { nativeImage, remote, ipcRenderer } from "electron";
import { appSearch, PluginHandler } from "@/core";
import path from "path";
import commonConst from "@/common/utils/commonConst";
import { execSync } from "child_process";
import searchManager from "./search";
import optionsManager from "./options";
@@ -43,12 +44,11 @@ const createPluginManager = (): any => {
})
),
});
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
// document.getElementById("search").value = "";
// state.searchValue = "";
setSearchValue("");
}
if (plugin.pluginType === "app") {
execSync(plugin.action);
}
};
const { searchValue, onSearch, setSearchValue, placeholder } = searchManager();
@@ -57,6 +57,7 @@ const createPluginManager = (): any => {
baseDir,
appList,
openPlugin,
currentPlugin: toRefs(state).currentPlugin,
});
// plugin operation
const getPluginInfo = async ({ pluginName, pluginPath }) => {
@@ -85,6 +86,12 @@ const createPluginManager = (): any => {
remote.getGlobal("LOCAL_PLUGINS").updatePlugin(currentPlugin);
};
window.initRubick = () => {
state.currentPlugin = {};
setSearchValue("");
window.setSubInput({ placeholder: "" });
};
return {
...toRefs(state),
initPlugins,