Ability to customize input in autocomplete

This commit is contained in:
Viktor Denisov
2022-10-16 00:44:34 -07:00
parent de491296c4
commit a396938c52
3 changed files with 60 additions and 8 deletions

View File

@@ -3,8 +3,8 @@
[[toc]]
## Load Google maps places
Before using Autocomplete, you should load the places library.
## Load Google maps places
Before using Autocomplete, you should load the places library.
```vue{5}
createApp(App)
@@ -20,7 +20,7 @@ createApp(App)
## Add autocomplete to your components
You can add autocomplete to your maps using GMapAutocomplete component.
You can add autocomplete to your maps using GMapAutocomplete component.
```vue
<template>
<GMapAutocomplete
@@ -45,6 +45,37 @@ export default {
```
## Custom input for autocomplete
You can customize input for autocomplete.
```vue
<template>
<GMapAutocomplete @place_changed="setPlace">
<template #input="slotProps">
<v-text-field
v-bind="slotProps"
ref="input"
prepend-inner-icon="mdi-map-marker"
hide-details
/>
</template>
</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