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
},
'find_name': function () {
var temp = []
for (var c of this.courses) {
if (c.name.indexOf(this.find_name) != -1) {
temp.push(c)
}
}
this.foundedCourses = temp
const target = this.find_name.toLowerCase();
this.foundedCourses = this.courses.filter((c) => c.name.toLowerCase().includes(target));
}
},
template: `