Skip to content

Commit

Permalink
Merge pull request #28 from Lemonnnnnnnnnnn/master
Browse files Browse the repository at this point in the history
优化搜索过滤功能以避免直接修改传入数据
  • Loading branch information
Lemonnnnnnnnnnn authored Mar 19, 2024
2 parents 4f21432 + d4039f4 commit f5407e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/request/components/TypesTree.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
function filter_data() {
if (searchKey === '') {
filtered_list = full_list;
return;
}
filtered_list = do_filter(full_list);
const deepFullListClone = JSON.parse(JSON.stringify(full_list));
filtered_list = do_filter(deepFullListClone);
function do_filter(list: TypesTree[]) {
return list.filter((item) => {
Expand Down

0 comments on commit f5407e3

Please sign in to comment.