title: Google autocomplete component requires refresh to load correctly Vuejs
body: <p>I made a component with an input which loads the google autocomplete (InputPlace.vue) and I'm using it in two views: home and search.</p>
  
  <p>First time I load the web, it works correctly, I use the component from the Home view to choose a location and redirect to the Search view. After that, I try to use it again, now from the Search view but it doesn't show the locations. So, I need to F5 to make it work again.</p>
  
  <p>After that, if I go back to Home view and try to use the component again it doesn't work. As before, I need to F5.</p>
  
  <p>This is my component (InputPlace.vue):</p>
  
  <pre><code>&lt;template&gt;
    &lt;label class="form-label-place" for="city"&gt;
      &lt;input class="form-control" type="text" id="inputPlace" name="city" placeholder="Ingresa tu ciudad"&gt;
    &lt;/label&gt;
  &lt;/template&gt;
  &lt;script&gt;
  export default {
    name: 'input-place',
    mounted() {
        // Google autocomplete
        google.maps.event.addDomListener(window, 'load', () =&gt; {
          var options = {
            types: ['(cities)'],
            componentRestrictions: {country: "PE"}
          };
          var places = new google.maps.places.Autocomplete(document.getElementById('inputPlace'), options);
          google.maps.event.addListener(places, 'place_changed', () =&gt; {
            this.$parent.placeChanged(places)
          });
        });
    }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is how I load the library in the index.html before closing the body (already tried adding it into the head)</p>
  
  <pre><code>&lt;script async refer src="https://maps.googleapis.com/maps/api/js?key=KEY&amp;libraries=places&amp;sensor=false&amp;language=es&amp;region=PE"&gt;&lt;/script&gt;
  </code></pre>