mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: throughCollection support fuzzy search (#3949)
This commit is contained in:
parent
47dffe55b5
commit
04b6d79dcb
@ -326,13 +326,13 @@ export const ThroughCollection = observer(
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
const handleSearch = (value: string) => {
|
const handleSearch = (value: string) => {
|
||||||
|
const data = loadCollections();
|
||||||
if (value) {
|
if (value) {
|
||||||
const filteredOptions = options.filter((option) => {
|
const filteredOptions = data.filter((option) => {
|
||||||
return option.label.toLowerCase().includes(value.toLowerCase());
|
return option.label.toLowerCase().includes(value.toLowerCase());
|
||||||
});
|
});
|
||||||
setOptions(filteredOptions);
|
setOptions(filteredOptions);
|
||||||
} else {
|
} else {
|
||||||
const data = loadCollections();
|
|
||||||
setOptions(data);
|
setOptions(data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user