mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-25 03:49:26 +08:00
✨ 支持插件开发者模式
This commit is contained in:
@@ -48,6 +48,7 @@ const props = defineProps({
|
||||
});
|
||||
|
||||
const changeValue = (e) => {
|
||||
if (props.currentPlugin.name === "rubick-system-feature") return;
|
||||
emit("onSearch", e);
|
||||
};
|
||||
|
||||
|
||||
@@ -6,13 +6,11 @@ import commonConst from "@/common/utils/commonConst";
|
||||
import { execSync } from "child_process";
|
||||
import searchManager from "./search";
|
||||
import optionsManager from "./options";
|
||||
|
||||
const appPath = remote.app.getPath("cache");
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/renderer";
|
||||
|
||||
const createPluginManager = (): any => {
|
||||
const baseDir = path.join(appPath, "./rubick-plugins");
|
||||
const pluginInstance = new PluginHandler({
|
||||
baseDir: baseDir,
|
||||
baseDir,
|
||||
});
|
||||
|
||||
const state: any = reactive({
|
||||
@@ -54,7 +52,6 @@ const createPluginManager = (): any => {
|
||||
const { searchValue, onSearch, setSearchValue, placeholder } = searchManager();
|
||||
const { options } = optionsManager({
|
||||
searchValue,
|
||||
baseDir,
|
||||
appList,
|
||||
openPlugin,
|
||||
currentPlugin: toRefs(state).currentPlugin,
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ref, toRaw, toRefs, watch } from "vue";
|
||||
import throttle from "lodash.throttle";
|
||||
import { remote } from "electron";
|
||||
import path from "path";
|
||||
import { PLUGIN_INSTALL_DIR as baseDir } from "@/common/constans/renderer";
|
||||
|
||||
function searchKeyValues(lists, value) {
|
||||
return lists.filter((item) => {
|
||||
@@ -12,7 +13,7 @@ function searchKeyValues(lists, value) {
|
||||
});
|
||||
}
|
||||
|
||||
const optionsManager = ({ searchValue, baseDir, appList, openPlugin, currentPlugin }) => {
|
||||
const optionsManager = ({ searchValue, appList, openPlugin, currentPlugin }) => {
|
||||
const optionsRef = ref([]);
|
||||
|
||||
watch(searchValue, () => search(searchValue.value));
|
||||
|
||||
Reference in New Issue
Block a user