如果没有categoryId的情况就不筛选

This commit is contained in:
pqcqaq 2024-10-19 09:53:21 +08:00
parent e98ce03861
commit 29643f126e
1 changed files with 3 additions and 1 deletions

View File

@ -43,7 +43,9 @@ export default OakComponent({
};
})
// 只能在这里做筛选,不知道有没有更好的做法
.filter((item) => item.categoryId === categoryId),
.filter(
(item) => !categoryId || item.categoryId === categoryId
),
};
},
});