minor
This commit is contained in:
@@ -12,6 +12,7 @@ v-row
|
||||
@input.native='search'
|
||||
persistent-hint
|
||||
:items="places"
|
||||
@focus='search'
|
||||
@change='selectPlace')
|
||||
template(v-slot:item="{ item, attrs, on }")
|
||||
v-list-item(v-bind='attrs' v-on='on')
|
||||
@@ -73,7 +74,7 @@ export default {
|
||||
search: debounce(async function(ev) {
|
||||
const search = ev.target.value.trim().toLowerCase()
|
||||
this.places = await this.$axios.$get(`place?search=${search}`)
|
||||
if (!search) { return this.places }
|
||||
if (!search && this.places.length) { return this.places }
|
||||
const matches = this.places.find(p => search === p.name.toLocaleLowerCase())
|
||||
if (!matches) {
|
||||
this.places.unshift({ create: true, name: ev.target.value.trim() })
|
||||
|
||||
Reference in New Issue
Block a user