Skip to content

Latest commit

 

History

History
78 lines (62 loc) · 1.94 KB

README.md

File metadata and controls

78 lines (62 loc) · 1.94 KB

vue-places

Places component is based on places.js for Vue 2.x.

Turn any into an address autocomplete

circle-ci npm version Dependencies npm downloads code style: prettier License: MIT


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>

Algolia Places Documentation