fixed a lot of details in the docs to make it better
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user