Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. <template>
  2. <section>
  3. <b-field
  4. label="Collection Address (Optional: Location of art if to be transported)"
  5. :type="{ 'is-danger': errors.has('addressdeliver') }"
  6. :message="errors.first('addressdeliver')"
  7. >
  8. <input
  9. ref="addressdeliver"
  10. v-model="addressdeliver"
  11. v-validate="{ required: true, regex: /^\s*\S+(?:\s+\S+){2}/ }"
  12. class="input search-location"
  13. onfocus="value = ''"
  14. name="addressdeliver"
  15. :disabled="
  16. servreq == 'Install Only' || servreq == 'General Consultation'
  17. "
  18. />
  19. </b-field>
  20. </section>
  21. </template>
  22.  
  23. <script>
  24. mounted() {
  25. // eslint-disable-next-line no-undef
  26. const defaultBounds = new google.maps.LatLngBounds(
  27. // eslint-disable-next-line no-undef
  28. new google.maps.LatLng(-33.8474, 151.2631)
  29. )
  30.  
  31. // eslint-disable-next-line no-undef
  32. this.adautocomplete = new google.maps.places.Autocomplete(
  33. this.$refs.addressdeliver,
  34. {
  35. bounds: defaultBounds,
  36. types: ['geocode'],
  37. componentRestrictions: { country: 'au' }
  38. }
  39. )
  40. this.adautocomplete.addListener('place_changed', () => {
  41. const placead = this.adautocomplete.getPlace()
  42. const acad = placead.formatted_address
  43.  
  44. this.addressdeliver = acad
  45. })
  46. }
  47. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement