mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-25 20:09:27 +08:00
⬆️ 升级 electron 到 26
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div
|
||||
id="components-layout"
|
||||
:class="commonConst.macOS() && 'drag'"
|
||||
@mousedown="onMouseDown"
|
||||
>
|
||||
<Search
|
||||
@@ -32,7 +31,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { watch, ref, nextTick, toRaw } from 'vue';
|
||||
import { ipcRenderer, remote } from 'electron';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import Result from './components/result.vue';
|
||||
import Search from './components/search.vue';
|
||||
import getWindowHeight from '../common/utils/getWindowHeight';
|
||||
@@ -41,6 +40,7 @@ import useDrag from '../common/utils/dragWindow';
|
||||
import commonConst from '@/common/utils/commonConst';
|
||||
|
||||
const { onMouseDown } = useDrag();
|
||||
const remote = window.require('@electron/remote');
|
||||
|
||||
const {
|
||||
initPlugins,
|
||||
|
||||
@@ -53,9 +53,10 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps, defineEmits, ref } from 'vue';
|
||||
import { ipcRenderer, remote } from 'electron';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { LoadingOutlined, MoreOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
const remote = window.require('@electron/remote');
|
||||
const opConfig = remote.getGlobal('OP_CONFIG');
|
||||
const { Menu } = remote;
|
||||
|
||||
@@ -261,6 +262,9 @@ window.rubick.hooks.onHide = () => {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.ellipse {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -284,7 +288,7 @@ window.rubick.hooks.onHide = () => {
|
||||
}
|
||||
|
||||
.main-input {
|
||||
height: 60px !important;
|
||||
height: 40px !important;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
border: none;
|
||||
|
||||
@@ -12,9 +12,9 @@ import App from './App.vue';
|
||||
|
||||
import 'ant-design-vue/dist/antd.variable.min.css';
|
||||
|
||||
const { remote } = window.require('electron');
|
||||
const { getGlobal } = window.require('@electron/remote');
|
||||
|
||||
const { perf } = remote.getGlobal('OP_CONFIG').get();
|
||||
const { perf } = getGlobal('OP_CONFIG').get();
|
||||
|
||||
ConfigProvider.config({
|
||||
theme: perf.custom || {},
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import getCopyFiles from '@/common/utils/getCopyFiles';
|
||||
import { clipboard, nativeImage, remote, ipcRenderer } from 'electron';
|
||||
import { clipboard, nativeImage, ipcRenderer } from 'electron';
|
||||
import { getGlobal } from '@electron/remote';
|
||||
import path from 'path';
|
||||
import pluginClickEvent from './pluginClickEvent';
|
||||
import { ref } from 'vue';
|
||||
@@ -7,7 +8,7 @@ import { ref } from 'vue';
|
||||
export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
const clipboardFile: any = ref([]);
|
||||
const searchFocus = () => {
|
||||
const config = remote.getGlobal('OP_CONFIG').get();
|
||||
const config = getGlobal('OP_CONFIG').get();
|
||||
// 未开启自动粘贴
|
||||
if (!config.perf.common.autoPast) return;
|
||||
|
||||
@@ -17,7 +18,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
if (fileList) {
|
||||
window.setSubInputValue({ value: '' });
|
||||
clipboardFile.value = fileList;
|
||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const options: any = [
|
||||
{
|
||||
name: '复制路径',
|
||||
@@ -143,7 +144,7 @@ export default ({ currentPlugin, optionsRef, openPlugin, setOptionsRef }) => {
|
||||
dataUrl,
|
||||
},
|
||||
];
|
||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const options: any = [];
|
||||
// 再正则插件
|
||||
localPlugins.forEach((plugin) => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { reactive, toRefs, ref } from 'vue';
|
||||
import { nativeImage, remote, ipcRenderer } from 'electron';
|
||||
import { nativeImage, ipcRenderer } from 'electron';
|
||||
import { getGlobal } from '@electron/remote';
|
||||
import appSearch from '@/core/app-search';
|
||||
import { PluginHandler } from '@/core';
|
||||
import path from 'path';
|
||||
@@ -112,7 +113,7 @@ const createPluginManager = (): any => {
|
||||
|
||||
window.updatePlugin = ({ currentPlugin }: any) => {
|
||||
state.currentPlugin = currentPlugin;
|
||||
remote.getGlobal('LOCAL_PLUGINS').updatePlugin(currentPlugin);
|
||||
getGlobal('LOCAL_PLUGINS').updatePlugin(currentPlugin);
|
||||
};
|
||||
|
||||
window.setCurrentPlugin = ({ currentPlugin }) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ref, watch } from 'vue';
|
||||
import throttle from 'lodash.throttle';
|
||||
import { remote, ipcRenderer } from 'electron';
|
||||
import { ipcRenderer } from 'electron';
|
||||
import { getGlobal } from '@electron/remote';
|
||||
import pluginClickEvent from './pluginClickEvent';
|
||||
import useFocus from './clipboardWatch';
|
||||
|
||||
@@ -40,7 +41,7 @@ const optionsManager = ({
|
||||
});
|
||||
|
||||
const getOptionsFromSearchValue = (value, strict = false) => {
|
||||
const localPlugins = remote.getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
const localPlugins = getGlobal('LOCAL_PLUGINS').getLocalPlugins();
|
||||
let options: any = [];
|
||||
// todo 先搜索 plugin
|
||||
localPlugins.forEach((plugin) => {
|
||||
|
||||
Reference in New Issue
Block a user