bugfix: 修复windows下读取插件preload.js位置问题;

ref:搜索插件不区分大消息
This commit is contained in:
muwoo 2021-09-22 15:38:52 +08:00
parent e9fa7b2276
commit 1c893542b9
4 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "rubick2",
"version": "0.0.7-beta.1",
"version": "0.0.7-beta.2",
"author": "muwoo <2424880409@qq.com>",
"description": "An electron-vue project",
"license": null,

View File

@ -305,7 +305,7 @@ export default {
renderTitle(title) {
if (typeof title !== "string") return;
const result = title.split(this.searchValue);
const result = title.toLowerCase().split(this.searchValue.toLowerCase());
if (result && result.length > 1) {
return `<div>${result[0]}<span style="color: red">${this.searchValue}</span>${result[1]}</div>`;
} else {

View File

@ -24,8 +24,8 @@ function getWindowHeight(searchList) {
function searchKeyValues(lists, value) {
return lists.filter((item) => {
if (typeof item === 'string') return item.indexOf(value) >= 0;
return item.type.indexOf(value) >= 0;
if (typeof item === 'string') return item.toLowerCase().indexOf(value.toLowerCase()) >= 0;
return item.type.toLowerCase().indexOf(value.toLowerCase()) >= 0;
});
}

View File

@ -22,7 +22,7 @@ function getQueryVariable(variable) {
if (location.href.indexOf('targetFile') > -1) {
filePath = decodeURIComponent(getQueryVariable('targetFile'));
} else {
filePath = process.platform === 'win32' ? location.pathname.split(':')[1] : location.pathname.replace('file://', '');
filePath = process.platform === 'win32' ? location.pathname.replace('/', '') : location.pathname.replace('file://', '');
}
const {ipcRenderer, nativeImage, clipboard, remote, shell} = require('electron');