@@ -125,9 +125,14 @@ export default {
|
||||
return matches
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$nextTick( () => {
|
||||
this.search()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
search: debounce(async function(ev) {
|
||||
const search = ev.target.value.trim().toLowerCase()
|
||||
const search = ev ? ev.target.value.trim().toLowerCase() : ''
|
||||
this.places = await this.$axios.$get(`place?search=${search}`)
|
||||
if (!search && this.places.length) { return this.places }
|
||||
const matches = this.places.find(p => search === p.name.toLocaleLowerCase())
|
||||
|
||||
Reference in New Issue
Block a user