mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 06:17:11 -04:00
🔧:build SSR dist and deploy
This commit is contained in:
parent
76c26901d7
commit
c59ad6aedb
465 changed files with 214127 additions and 2 deletions
22
dist/server/chunks/chunk-2ce6ed5e.js
vendored
Normal file
22
dist/server/chunks/chunk-2ce6ed5e.js
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { get } from '@vueuse/core';
|
||||
import Fuse from 'fuse.js';
|
||||
import { computed } from 'vue';
|
||||
|
||||
function useFuzzySearch({
|
||||
search,
|
||||
data,
|
||||
options = {}
|
||||
}) {
|
||||
const fuse = new Fuse(data, options);
|
||||
const filterEmpty = options.filterEmpty ?? true;
|
||||
const searchResult = computed(() => {
|
||||
const query = get(search);
|
||||
if (!filterEmpty && query === "") {
|
||||
return data;
|
||||
}
|
||||
return fuse.search(query).map(({ item }) => item);
|
||||
});
|
||||
return { searchResult };
|
||||
}
|
||||
|
||||
export { useFuzzySearch as u };
|
Loading…
Add table
Add a link
Reference in a new issue