mirror of
https://github.com/usememos/memos.git
synced 2025-09-13 17:24:27 +08:00
feat: search for multiple words (#4362)
This commit is contained in:
parent
6c088e09d9
commit
03267d6d37
1 changed files with 6 additions and 4 deletions
|
@ -17,10 +17,12 @@ const SearchBar = () => {
|
|||
if (e.key === "Enter") {
|
||||
e.preventDefault();
|
||||
if (queryText !== "") {
|
||||
memoFilterStore.removeFilter((f) => f.factor === "contentSearch");
|
||||
memoFilterStore.addFilter({
|
||||
factor: "contentSearch",
|
||||
value: queryText,
|
||||
const words = queryText.split(" ");
|
||||
words.forEach((word) => {
|
||||
memoFilterStore.addFilter({
|
||||
factor: "contentSearch",
|
||||
value: word,
|
||||
});
|
||||
});
|
||||
setQueryText("");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue