0

Is it possible to list cities only in vuetify-google-autocomplete like this? (image attached)

Target

My current autocomplete looks like this, and it's searching for full addresses by default.

Actual

I couldn't find information on this topic in the documentation or on any other pages, so I am asking for help here.

My code :

App.js :

import VuetifyGoogleAutocomplete from 'vuetify-google-autocomplete';

Vue.use(VuetifyGoogleAutocomplete, {
  apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
  installComponents: true,
  vueGoogleMapsCompatibility: false
});

Component.js :

<vuetify-google-autocomplete
  type="text"
  ref="location"
  v-model="location"
  id="map"
  v-on:placechanged="getAddressData"
>
Przemek Baj
  • 426
  • 2
  • 5
  • 18
  • You may find this question helpful: https://stackoverflow.com/questions/8282026/how-to-limit-google-autocomplete-results-to-city-and-country-only – Mario Klisanic Feb 03 '21 at 13:23

1 Answers1

1

Yes there is! You can do this:

  <vuetify-google-autocomplete
      id="map"
      placeholder="Location"
      types="(cities)"
  >
  </vuetify-google-autocomplete>
Ashley
  • 11
  • 2