Merge pull request #16 from x3388638/patch-search-case

Search courses case-insensitively
This commit is contained in:
snsd0805 2021-01-24 17:19:49 +08:00 committed by GitHub
commit 6d9a9a55db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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: `