Merge pull request #16 from x3388638/patch-search-case
Search courses case-insensitively
This commit is contained in:
commit
6d9a9a55db
@ -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: `
|
||||
|
||||
Loading…
Reference in New Issue
Block a user