mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-22 18:22:53 +08:00
♻️ search 框输入交互优化
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user