Add docs folder
This commit is contained in:
61
docs/src/components/autocomplete.md
Normal file
61
docs/src/components/autocomplete.md
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
# Autocomplete
|
||||
[[toc]]
|
||||
|
||||
|
||||
## Load Google maps places
|
||||
Before using Autocomplete, you should load the places library.
|
||||
|
||||
```vue{5}
|
||||
createApp(App)
|
||||
.use(VueGoogleMaps, {
|
||||
load: {
|
||||
key: "",
|
||||
libraries: "places"
|
||||
}
|
||||
})
|
||||
.mount("#app");
|
||||
</script>
|
||||
```
|
||||
|
||||
|
||||
## Add autocomplete to your components
|
||||
You can add autocomplete to your maps using GMapAutocomplete component.
|
||||
```vue
|
||||
<template>
|
||||
<GMapAutocomplete
|
||||
placeholder="This is a placeholder"
|
||||
@place_changed="setPlace"
|
||||
>
|
||||
</GMapAutocomplete>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setPlace() {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
```
|
||||
|
||||
## Custom options
|
||||
You can pass google maps auto complete options using options prop
|
||||
|
||||
```vue{9}
|
||||
<template>
|
||||
<GMapAutocomplete
|
||||
placeholder="This is a placeholder"
|
||||
:options="{
|
||||
bounds: {north: 1.4, south: 1.2, east: 104, west: 102},
|
||||
strictBounds: true
|
||||
}"
|
||||
/>
|
||||
</template>
|
||||
```
|
||||
Reference in New Issue
Block a user