vue-places
v2.2.2
Published
Places component is based on [places.js](https://github.com/algolia/places) for Vue 2.x.
Downloads
574
Maintainers
Readme
vue-places
Places component is based on places.js for Vue 2.x.
Turn any into an address autocomplete
Installation
# yarn
$ yarn add vue-places
# npm
$ npm install vue-places --save
Example
<template>
<places
v-model="form.country.label"
placeholder="Where are we going ?"
@change="val => { form.country.data = val }"
:options="options">
</places>
</template>
<script>
import Places from 'vue-places';
export default {
data() {
return {
options: {
appId: <YOUR_PLACES_APP_ID>,
apiKey: <YOUR_PLACES_API_KEY>,
countries: ['US'],
},
form: {
country: {
label: null,
data: {},
},
},
};
},
components: {
Places,
},
}
</script>