@@ -52,18 +62,15 @@ const props = defineProps({
default: 0,
},
currentPlugin: {},
+ pluginHistory: (() => [])(),
clipboardFile: (() => [])(),
});
-const renderTitle = (title) => {
+const renderTitle = (title, match) => {
if (typeof title !== 'string') return;
- if (!props.searchValue) return title;
- const result = title.toLowerCase().split(props.searchValue.toLowerCase());
- if (result && result.length > 1) {
- return `${result[0]}${props.searchValue}${result[1]}
`;
- } else {
- return `${result[0]}
`;
- }
+ if (!props.searchValue || !match) return title;
+ const result = title.substring(match[0], match[1] + 1);
+ return `${title.substring(0, match[0])}${result}${title.substring(match[1]+1, title.length)}
`;
};
const renderDesc = (desc) => {
@@ -91,15 +98,45 @@ const sort = (options) => {