1616 </div >
1717 </slot >
1818 </div >
19-
2019 <div class =" pac-input-container" >
21- <slot name =" before-input" ></ slot >
22- <input ref =" input" type =" text" :value = " model " @input =" onInputChange" :placeholder =" placeholder" >
23- <slot name =" after-input" ></ slot >
20+ <slot name =" before-input" / >
21+ <input ref =" input" type =" text" v-model = " autocompleteModel " @input =" onInputChange" :placeholder =" placeholder" >
22+ <slot name =" after-input" / >
2423 </div >
2524 </div >
2625</template >
@@ -47,8 +46,8 @@ export default {
4746 FindElement,
4847 Ready
4948 ],
50-
5149 props: {
50+ value: null ,
5251 model: String ,
5352 placeholder: {
5453 type: String ,
@@ -67,13 +66,21 @@ export default {
6766 default: true
6867 }
6968 },
70-
69+ computed: {
70+ autocompleteModel: {
71+ get () {
72+ return this .value
73+ },
74+ set (value) {
75+ this .$emit (' input' , value)
76+ }
77+ }
78+ },
7179 data () {
7280 return {
7381 localTypes: this .$props .types
7482 }
7583 },
76-
7784 methods: {
7885 ... redirectMethods ({
7986 target () {
@@ -85,12 +92,10 @@ export default {
8592 this .$emit (' update:model' , event .target .value )
8693 }
8794 },
88-
8995 watch: {
9096 localTypes: ' setTypes' ,
9197 types: ' setTypes'
9298 },
93-
9499 created () {
95100 const mapAncestor = this .$_findAncestor (
96101 a => a .$options .name === ' GoogleMap'
@@ -100,12 +105,10 @@ export default {
100105 }
101106 this .$_mapAncestor = mapAncestor
102107 },
103-
104108 async googleMapsPrepare () {
105109 const mapComp = this .$_mapAncestor
106110 this .$_map = mapComp ? await mapComp .$_getMap () : null
107111 },
108-
109112 googleMapsReady () {
110113 this .$_autocomplete = new window.google.maps.places.Autocomplete (this .$refs .input )
111114 this .$_autocomplete .setTypes (this .$props .types )
0 commit comments