Search courses case-insensitively

This commit is contained in:
YY 2021-01-24 16:51:34 +08:00
parent f5825cc263
commit 2875c78b73

View File

@ -53,13 +53,8 @@ var coursesList = {
this.selectedTime = temp this.selectedTime = temp
}, },
'find_name': function () { 'find_name': function () {
var temp = [] const target = this.find_name.toLowerCase();
for (var c of this.courses) { this.foundedCourses = this.courses.filter((c) => c.name.toLowerCase().includes(target));
if (c.name.indexOf(this.find_name) != -1) {
temp.push(c)
}
}
this.foundedCourses = temp
} }
}, },
template: ` template: `