vue-google-places
Version:
Vue Google Places Autocomplete
38 lines (36 loc) • 649 B
JavaScript
import VueGooglePlaces from './VueGooglePlaces'
export default {
props: {
value: String,
},
data () {
return {
val: this.value,
place: null
}
},
watch: {
value (value) {
this.val = value
}
},
render (h) {
return h(VueGooglePlaces, {
ref: 'gp',
attrs: this.$attrs,
on: {
...this.$listeners,
placechanged: (place) => {
this.place = place
this.$emit('placechanged', place)
},
input: (value) => {
this.val = value
this.$emit('input', value)
}
}
}, [
this.renderInput()
])
}
}