No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Rohit
    3. Best
    R
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 10
    • Best 2
    • Groups 0

    Best posts made by Rohit

    • RE: Google autocomplete places with q-input

      Here is the solution that worked for me without any package.
      it might help some one.
      <template>
      <q-input
      ref=“autocomplete”
      filled
      v-model=“user.address”
      label=“Physical Address”
      for=“address” //id attribute
      hint=“Your permanent address”
      :rules="[val => !!val || ‘This field is required.’]"
      />
      </template>

      and in mounted
      <script>
      mounted() {
      this.autocomplete = new google.maps.places.Autocomplete(
      // (this.$refs.autocomplete),
      (document.getElementById(“address”)),
      {types: [‘geocode’]}
      );
      this.autocomplete.addListener(‘place_changed’, () => {
      let place = this.autocomplete.getPlace();
      let ac = place.address_components;
      console.log(ac);
      }
      });
      <script>

      posted in Help
      R
      Rohit
    • RE: Google auto populate address without map

      I remove the the vue-google-autocomplete package.

      Import
      <script src=“https://maps.googleapis.com/maps/api/js?key=APIKEY&libraries=places”></script>

      I find out that i was giving reference instead of id, I guess google map api only work with id attribute.

      Here is the solution that worked for me. it might help some one.
      <q-input
      ref=“autocomplete”
      filled
      v-model=“user.address”
      label=“Physical Address”
      for=“address” //id attribute
      hint=“Your permanent address”
      :rules="[val => !!val || ‘This field is required.’]"
      />

      and in mounted

      mounted() {
      this.autocomplete = new google.maps.places.Autocomplete(
      // (this.$refs.autocomplete),
      (document.getElementById(“address”)),
      {types: [‘geocode’]}
      );
      this.autocomplete.addListener(‘place_changed’, () => {
      let place = this.autocomplete.getPlace();
      let ac = place.address_components;
      console.log(ac);
      }
      });

      Also Thanks for your time @dobbel

      posted in Framework
      R
      Rohit