fixed a lot of details in the docs to make it better

This commit is contained in:
NathanAP
2022-10-18 09:21:56 -03:00
parent 749a090b5f
commit e81b96471f
22 changed files with 15548 additions and 886 deletions

View File

@@ -1,52 +1,49 @@
# Autocomplete
Here you will find some uses for Google Maps Autocomplete component:
[[toc]]
## Pre-requisite: load places library
## Load Google maps places
Before using Autocomplete, you should load the places library.
Before using Autocomplete, you need to load the places library:
```vue{5}
```js
createApp(App)
.use(VueGoogleMaps, {
load: {
key: "",
libraries: "places"
}
key: 'YOUR_API_KEY_COMES_HERE',
libraries: 'places',
},
})
.mount("#app");
</script>
.mount('#app')
```
## Adding Autocomplete to your components
## Add autocomplete to your components
You can add autocomplete to your maps using GMapAutocomplete component.
```vue
You can add an Autocomplete to your `template` using `GMapAutocomplete` component:
```html
<template>
<GMapAutocomplete
placeholder="This is a placeholder"
@place_changed="setPlace"
>
</GMapAutocomplete>
<GMapAutocomplete placeholder="This is a placeholder" @place_changed="setPlace" />
</template>
<script>
export default {
name: 'App',
data() {
return {
}
},
methods: {
setPlace() {
}
}
}
</script>
<script>
export default {
name: 'App',
data() {
return {}
},
methods: {
setPlace() {},
},
}
</script>
```
## Custom options
You can pass google maps auto complete options using options prop
## Adding custom options
You can pass Google Maps Autocomplete options using the prop `options`:
```vue{9}
<template>