perf: add problem filter repeat

This commit is contained in:
wangdan-fit2cloud 2024-12-18 14:10:33 +08:00
parent bdea68c4e6
commit 88deedad6c

View File

@ -98,9 +98,14 @@ function delProblemHandle(item: any, index: number) {
}
function addProblemHandle() {
if (problemValue.value.trim()) {
if (
!detail.value?.problem_list.some((item: any) => item.content === problemValue.value.trim())
) {
detail.value?.problem_list?.push({
content: problemValue.value.trim()
})
}
problemValue.value = ''
isAddProblem.value = false
}