I'm using quasar framework. And VueGmaps package for autopopulate adress, which i installed it using npm install vue-gmaps --save
<script>
import Vue from "vue";
import VueGmaps from 'vue-gmaps'
mounted() {
this.autocomplete = new google.maps.places.Autocomplete(
(this.$refs.autocomplete),
{
type: ['geocode'],
componentRestrictions: { country: 'NZ' }
}
)
this.autocomplete.addListener('changed_place',()=>{
let place = this.autocomplete.getPlace()
let ac = place.address_components
let city = ac
this.city = city
this.cities.push(ac[0]['short_name'].concat(', ',ac[2]['short_name']))
console.log(this.city);
})
},
</script>
<teamplate>
<q-input
ref="autocomplete"
v-model="user.address"
filled
label="Physical Address"
hint="Your permanent address"
:rules="[val => !!val || 'This field is required.']"
/>
</template>
I’m getting error google is not defined in console. please check screenshot below
I want this to give suggestion of address when anyone types anything in the textfield & take the city, state, street from the address without displaying map.
can anyone help me with this please?
Thanks