Case agnostic search
This commit is contained in:
parent
67cca39c0b
commit
b56a19c201
@ -129,8 +129,10 @@
|
||||
},
|
||||
computed: {
|
||||
searched: function () {
|
||||
console.log(this.searchterm)
|
||||
let searchRegex = new RegExp(this.searchterm, 'i')
|
||||
return this.$store.state.Airports.airports
|
||||
.filter(a => a.properties.icao.match(this.searchterm) || a.properties.name.match(this.searchterm))
|
||||
.filter(a => searchRegex.test(a.properties.icao) || searchRegex.test(a.properties.name))
|
||||
// .map(a => console.log(a.properties))
|
||||
.map(a => ({ icao: a.properties.icao, name: a.properties.name }))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user